Changeset 2880249
- Timestamp:
- 03/15/2023 07:20:00 AM (3 years ago)
- Location:
- aiwriter
- Files:
-
- 14 added
- 14 edited
- 1 copied
-
tags/0.8.0 (copied) (copied from aiwriter/trunk)
-
tags/0.8.0/README.md (modified) (1 diff)
-
tags/0.8.0/aiwriter.php (modified) (6 diffs)
-
tags/0.8.0/build/blockEditor.asset.php (modified) (1 diff)
-
tags/0.8.0/build/blockEditor.js (modified) (1 diff)
-
tags/0.8.0/build/chatWindow.asset.php (added)
-
tags/0.8.0/build/chatWindow.css (added)
-
tags/0.8.0/build/chatWindow.js (added)
-
tags/0.8.0/build/classicEditor.asset.php (modified) (1 diff)
-
tags/0.8.0/build/classicEditor.js (modified) (1 diff)
-
tags/0.8.0/languages (added)
-
tags/0.8.0/languages/aiwriter.pot (added)
-
tags/0.8.0/languages/de_DE.mo (added)
-
tags/0.8.0/languages/de_DE.po (added)
-
tags/0.8.0/readme.txt (modified) (3 diffs)
-
trunk/README.md (modified) (1 diff)
-
trunk/aiwriter.php (modified) (6 diffs)
-
trunk/build/blockEditor.asset.php (modified) (1 diff)
-
trunk/build/blockEditor.js (modified) (1 diff)
-
trunk/build/chatWindow.asset.php (added)
-
trunk/build/chatWindow.css (added)
-
trunk/build/chatWindow.js (added)
-
trunk/build/classicEditor.asset.php (modified) (1 diff)
-
trunk/build/classicEditor.js (modified) (1 diff)
-
trunk/languages (added)
-
trunk/languages/aiwriter.pot (added)
-
trunk/languages/de_DE.mo (added)
-
trunk/languages/de_DE.po (added)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
aiwriter/tags/0.8.0/README.md
r2862261 r2880249 1 # AiWriter1 # What is AiWriter? 2 2 3 AiWriter is a revolutionary WordPress plugin that uses GPT-3 technology to help you write beautiful, unique texts. With 4 AiWriter, you'll never have to worry about what to write - the plugin does it for you. 3 ## Boost Your Content Creation with AI-Powered Writing: The Ultimate AiWriter Plugin for WordPress Bloggers and Writers. 5 4 6 AiWriter is perfect for bloggers, online entrepreneurs, and anyone looking to create high-quality content quickly and 7 efficiently. With AiWriter, you can focus on what really matters: sharing your ideas and achieving your goals. 5 Hello 👋, welcome to AiWriter - the ultimate AI-powered WordPress plugin for bloggers, writers and copywriters! If you're 6 someone who wants to create high-quality, engaging content without spending countless hours brainstorming and 7 researching, then AiWriter is perfect for you. Our AI technology does the heavy lifting of content creation so you can 8 spend more time on the creative process. 8 9 9 Try AiWriter now and see for yourself how easy and powerful writing content can be! 10 ### AI Content Generation 11 12 With AiWriter you can create unique, SEO-optimised content quickly and efficiently. All you have to do is type "+++" and 13 let our advanced ChatGPT language model do the rest! It helps you create content that is not only unique, but also 14 engaging and informative. Whether you're a blogger, writer or copywriter, AiWriter is a valuable tool that can 15 streamline your workflow, save you time and improve the quality of your work. Our AI-powered content creation 16 capabilities provide you with content that is tailored to your style and needs. So what are you waiting for? Install 17 AiWriter today and unlock the power of AI content creation in WordPress. With our plugin, you can take your content 18 writing to the next level and produce high-quality, engaging content that your readers will love. Trust us, once you try 19 AiWriter, you won't want to go back to traditional content creation methods! 20 21 ### The Power of AI for Content Creation 22 23 The power of the AiWriter plugin comes from its use of Chat-GPT, an advanced AI language model that uses natural 24 language processing to generate content. Chat-GPT is a state-of-the-art AI model that produces content that is unique, 25 engaging and informative. With our AI-powered content creation capabilities, you can generate content that is tailored 26 to your preferences and style. 27 28 ### Conduct Research in WordPress 29 30 Exciting news! As of version 0.8.0, we've integrated Chat-GPT into AiWriter to make it even more powerful and versatile. 31 With this integration, you can now conduct thorough research and write informative and engaging content within 32 WordPress. Using Chat-GPT's AI-powered natural language processing, you can gain valuable insights and inspiration for 33 your content. Whether you're researching a specific topic or looking for related keywords, Chat-GPT has you covered. 34 With this integration, you can access Chat-GPT directly from AiWriter, streamlining the process of creating high-quality 35 content. So if you're looking for a tool to help you create unique, informative content, AiWriter is the perfect 36 solution. With our latest update, you can now harness the power of Chat-GPT directly from WordPress and take your 37 content creation to the next level. 38 39 ## Installation 40 41 Read more 42 about [how to install plugins here](https://wordpress.org/support/article/managing-plugins/#installing-plugins-1). 43 44 ## How to get started? 45 46 1. Install the plugin as described in the Installation section. 47 2. Then create a new post or page. 48 3. In the block editor, the settings can be found under the new "AI" icon that appears in the top right corner. 49 4. In the classic editor, the settings can be found under the "AiWriter" metabox, which should appear on the right-hand 50 side. 51 5. Enter your activation key and click "Save". 52 6. If you're on a paid plan, enter your OpenAI API in the 'OpenAI' panel. 53 54 ## More questions? 55 56 You can find the [FAQ of the AiWriter](https://aiwriter.space#faq) here. -
aiwriter/tags/0.8.0/aiwriter.php
r2872577 r2880249 5 5 * Requires at least: 6.0.0 6 6 * Requires PHP: 8.0.0 7 * Version: 0. 7.27 * Version: 0.8.0 8 8 * Author: floriansimeth 9 9 * License: GPL-2.0-or-later … … 25 25 define( 'AIWRITER_API_URL', 'https://aiwriter.space/api/' ); 26 26 define( 'AIWRITER_STREAM_URL', 'https://stream.aiwriter.workers.dev' ); 27 28 add_action( 'init', 'wpbuddy\ai_writer\loadTranslation' ); 29 30 function loadTranslation(): void { 31 load_plugin_textdomain( 'aiwriter', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 32 } 27 33 28 34 add_action( 'init', 'wpbuddy\ai_writer\registerSettings' ); … … 523 529 $assetClassicEditor['version'] 524 530 ); 531 532 $assetsChatWindow = include __DIR__ . '/build/chatWindow.asset.php'; 533 534 wp_register_script( 535 'ai-writer-chat-window', 536 plugins_url( '/build/chatWindow.js', __FILE__ ), 537 $assetsChatWindow['dependencies'], 538 $assetsChatWindow['version'], 539 true 540 ); 541 542 wp_register_style( 543 'ai-writer-chat-window', 544 plugins_url( '/build/chatWindow.css', __FILE__ ), 545 [], 546 $assetsChatWindow['version'] 547 ); 525 548 } 526 549 … … 590 613 'before' 591 614 ); 615 616 wp_enqueue_script( 'ai-writer-chat-window' ); 617 wp_enqueue_style( 'ai-writer-chat-window' ); 592 618 } 593 619 … … 797 823 } 798 824 799 add_action( 'edit_form_after_editor', 'wpbuddy\ai_writer\adminPostsFooter ' );825 add_action( 'edit_form_after_editor', 'wpbuddy\ai_writer\adminPostsFooterClassicEditor' ); 800 826 801 827 /** 802 828 * @return void 803 829 * @since 0.4.0 804 */ 805 function adminPostsFooter(): void { 830 * @since 0.8.0 Renamed from `adminPostsFooter` 831 */ 832 function adminPostsFooterClassicEditor(): void { 806 833 echo '<div id="aiWriterNotices"></div>'; 807 834 } … … 841 868 <?php 842 869 } 870 871 872 add_action( 'admin_footer-post-new.php', 'wpbuddy\ai_writer\adminPostsFooter' ); 873 add_action( 'admin_footer-post.php', 'wpbuddy\ai_writer\adminPostsFooter' ); 874 875 /** 876 * @return void 877 * @since 0.8.0 878 */ 879 function adminPostsFooter(): void { 880 echo '<div id="aiWriterChat"></div>'; 881 } -
aiwriter/tags/0.8.0/build/blockEditor.asset.php
r2871571 r2880249 1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-plugins'), 'version' => ' 83e25a08a6002e783c03');1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-plugins'), 'version' => '5fd43d2f47eb50653664'); -
aiwriter/tags/0.8.0/build/blockEditor.js
r2871571 r2880249 1 (()=>{var e={705:(e,t,r)=>{var i=r(639).Symbol;e.exports=i},239:(e,t,r)=>{var i=r(705),n=r(607),a=r(333),o=i?i.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},561:(e,t,r)=>{var i=r(990),n=/^\s+/;e.exports=function(e){return e?e.slice(0,i(e)+1).replace(n,""):e}},957:(e,t,r)=>{var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=i},607:(e,t,r)=>{var i=r(705),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,l=i?i.toStringTag:void 0;e.exports=function(e){var t=a.call(e,l),r=e[l];try{e[l]=void 0;var i=!0}catch(e){}var n=o.call(e);return i&&(t?e[l]=r:delete e[l]),n}},333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},639:(e,t,r)=>{var i=r(957),n="object"==typeof self&&self&&self.Object===Object&&self,a=i||n||Function("return this")();e.exports=a},990:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},279:(e,t,r)=>{var i=r(218),n=r(771),a=r(841),o=Math.max,l=Math.min;e.exports=function(e,t,r){var c,s,u,p,d,w,m=0,v=!1, f=!1,C=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function _(t){var r=c,i=s;return c=s=void 0,m=t,p=e.apply(i,r)}function g(e){return m=e,d=setTimeout(y,t),v?_(e):p}function h(e){var r=e-w;return void 0===w||r>=t||r<0||f&&e-m>=u}function y(){var e=n();if(h(e))return E(e);d=setTimeout(y,function(e){var r=t-(e-w);return f?l(r,u-(e-m)):r}(e))}function E(e){return d=void 0,C&&c?_(e):(c=s=void 0,p)}function b(){var e=n(),r=h(e);if(c=arguments,s=this,w=e,r){if(void 0===d)return g(w);if(f)return clearTimeout(d),d=setTimeout(y,t),_(w)}return void 0===d&&(d=setTimeout(y,t)),p}return t=a(t)||0,i(r)&&(v=!!r.leading,u=(f="maxWait"in r)?o(a(r.maxWait)||0,t):u,C="trailing"in r?!!r.trailing:C),b.cancel=function(){void 0!==d&&clearTimeout(d),m=0,c=w=s=d=void 0},b.flush=function(){return void 0===d?p:E(n())},b}},218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},448:(e,t,r)=>{var i=r(239),n=r(5);e.exports=function(e){return"symbol"==typeof e||n(e)&&"[object Symbol]"==i(e)}},771:(e,t,r)=>{var i=r(639);e.exports=function(){return i.Date.now()}},841:(e,t,r)=>{var i=r(561),n=r(218),a=r(448),o=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=i(e);var r=l.test(e);return r||c.test(e)?s(e.slice(2),r?2:8):o.test(e)?NaN:+e}}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";window.React;const e=window.wp.plugins,t=window.wp.element,i=window.wp.i18n,n=window.wp.editPost,a=window.wp.components,o=()=>(0,t.createElement)(a.Icon,{icon:()=>(0,t.createElement)("svg",{width:"32",height:"24",viewBox:"0 0 122 91",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M42.824 2.70399L73.288 72.592C74.7387 75.7493 75.9333 78.1813 76.872 79.888C77.8107 81.5947 78.7493 82.7893 79.688 83.472C80.712 84.1547 81.864 84.624 83.144 84.88C83.4853 85.9893 83.6987 86.928 83.784 87.696C83.8693 88.464 83.912 89.36 83.912 90.384C83.0587 90.2987 81.736 90.2133 79.944 90.128C78.152 90.128 76.2747 90.0853 74.312 90C72.3493 90 70.6853 90 69.32 90C68.296 90 67.1013 90 65.736 90C64.3707 90.0853 62.9627 90.128 61.512 90.128C60.0613 90.2133 58.7387 90.256 57.544 90.256C56.4347 90.3413 55.5387 90.384 54.856 90.384C54.856 89.36 54.8987 88.3787 54.984 87.44C55.1547 86.5013 55.4107 85.648 55.752 84.88C59.2507 84.4533 61.2987 83.6853 61.896 82.576C62.5787 81.3813 62.0667 78.8213 60.36 74.896L42.568 33.296C41.4587 30.6507 40.4773 28.304 39.624 26.256C38.7707 24.208 37.7467 21.6053 36.552 18.448H37.192C36.168 21.6907 35.2293 24.464 34.376 26.768C33.608 28.9867 32.84 31.12 32.072 33.168L17.48 71.184C15.6027 76.2187 15.0053 79.7173 15.688 81.68C16.456 83.5573 18.5893 84.624 22.088 84.88C22.4293 85.648 22.6427 86.5013 22.728 87.44C22.8987 88.3787 22.984 89.36 22.984 90.384C22.0453 90.2987 20.8933 90.2133 19.528 90.128C18.1627 90.128 16.712 90.0853 15.176 90C13.7253 90 12.2747 90 10.824 90C8.69067 90 6.68533 90.0427 4.808 90.128C2.93067 90.2133 1.39467 90.2987 0.200001 90.384C0.200001 89.5307 0.242667 88.6347 0.328001 87.696C0.498667 86.672 0.754668 85.776 1.096 85.008C2.632 84.6667 3.912 84.0693 4.936 83.216C5.96 82.3627 6.94133 80.9973 7.88 79.12C8.904 77.1573 10.056 74.512 11.336 71.184L37.832 3.216C38.6853 3.04533 39.4533 2.91733 40.136 2.83199C40.904 2.74666 41.8 2.70399 42.824 2.70399ZM54.472 56.08L55.624 61.84C49.9067 61.84 43.7627 61.8827 37.192 61.968C30.7067 62.0533 24.8187 62.1813 19.528 62.352L21.576 56.08H54.472Z",fillRule:"evenodd"}),(0,t.createElement)("path",{d:"M91.861 90.384C91.861 89.5307 91.9037 88.6347 91.989 87.696C92.0743 86.672 92.245 85.7333 92.501 84.88C95.9143 84.88 98.2183 84.112 99.413 82.576C100.693 80.9547 101.333 78.0107 101.333 73.744V48.4C101.333 46.352 101.12 44.688 100.693 43.408C100.352 42.0427 99.4983 41.0187 98.133 40.336C96.7677 39.6533 94.6343 39.312 91.733 39.312C91.733 38.3733 91.8183 37.52 91.989 36.752C92.1597 35.984 92.4583 35.2587 92.885 34.576C94.165 34.576 95.957 34.3627 98.261 33.936C100.65 33.5093 102.954 32.9547 105.173 32.272C107.392 31.5893 109.013 30.9067 110.037 30.224C110.805 30.48 111.445 30.992 111.957 31.76C112.554 32.528 112.853 33.7227 112.853 35.344V73.744C112.853 78.0107 113.408 80.9547 114.517 82.576C115.712 84.112 117.674 84.88 120.405 84.88C120.661 85.7333 120.832 86.7147 120.917 87.824C121.002 88.9333 121.045 89.7867 121.045 90.384C119.594 90.2987 118.058 90.2133 116.437 90.128C114.816 90.128 113.152 90.0853 111.445 90C109.824 90 108.202 90 106.581 90C104.96 90 103.253 90 101.461 90C99.7543 90.0853 98.0903 90.128 96.469 90.128C94.8477 90.2133 93.3117 90.2987 91.861 90.384ZM106.069 15.76C103.936 15.76 102.144 15.0347 100.693 13.584C99.2423 12.1333 98.517 10.384 98.517 8.336C98.517 6.032 99.285 4.15466 100.821 2.70399C102.357 1.25333 104.106 0.527992 106.069 0.527992C108.373 0.527992 110.208 1.25333 111.573 2.70399C113.024 4.15466 113.749 6.032 113.749 8.336C113.749 10.2987 112.981 12.048 111.445 13.584C109.994 15.0347 108.202 15.76 106.069 15.76Z",fillRule:"evenodd"}))});var l=r(279),c=r.n(l);const s=window.wp.apiFetch;var u=r.n(s);const p=window.wp.data,d=window.wp.notices,w=()=>{let{AiWriter:e}=window;const[r,n]=(0,t.useState)(!1),[o,l]=(0,t.useState)(e.isActive),[s,w]=(0,t.useState)(e.temperature),[m,v]=(0,t.useState)(e.textLength),f=c()(_,2e3),{createErrorNotice:C}=(0,p.useDispatch)(d.store);function _(t,r){let i={};i["aiwriter_"+t]=r,n(!0),u()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{e[t]=r,n(!1)})).catch((t=>{e.debug&&console.error(t),n(!1),C(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1})}))}return(0,t.createElement)(a.PanelBody,{title:(0,i.__)("Text generation settings","aiwriter")},(0,t.createElement)("p",null,(0,t.createElement)(a.FormToggle,{checked:o,onChange:()=>{l((e=>!e)),e.isActive=!o,_("isActive",e.isActive)}})," ",(0,i.__)("Activate AiWriter","aiwriter")),(0,t.createElement)(a.RangeControl,{label:(0,i.__)("Creativity","aiwriter"),value:s,onChange:e=>{w(e),f("temperature",e)},min:0,max:1,step:.1,withInputField:!1,renderTooltipContent:e=>e<=0?(0,i.__)("Not creative at all","aiwriter"):e>=.8?(0,i.__)("Very creative","aiwriter"):e>=.5?(0,i.__)("Reasonably creative","aiwriter"):e<.5?(0,i.__)("Rather less creative","aiwriter"):void 0}),(0,t.createElement)(a.RangeControl,{label:(0,i.__)("Max. text length","aiwriter"),value:m,onChange:e=>{v(e),f("textLength",e)},min:200,max:1e3,showTooltip:!1,marks:[{value:200,label:(0,i.__)("Little","aiwriter")},{value:400,label:(0,i.__)("Medium","aiwriter")},{value:600,label:(0,i.__)("Long","aiwriter")},{value:800,label:(0,i.__)("Very long","aiwriter")},{value:1e3,label:(0,i.__)("Maximum","aiwriter")}],step:200,withInputField:!1}))},m=()=>{let{AiWriter:e}=window;const[r,n]=(0,t.useState)(!1),[o,l]=(0,t.useState)(""),[s,m]=(0,t.useState)(""),{createErrorNotice:v}=(0,p.useDispatch)(d.store),f=c()((function(t){if(""===t)return;const{editorType:r}=window.AiWriter;n(!0),u()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/activation_code","aiwriter/activation_code":t}}).then((e=>{n(!1)})).catch((t=>{e.debug&&console.error(t),n(!1),v(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===r?"aiWriter":"global"})}))}),1e3),C=c()((function(t){if(""===t)return;const{editorType:r}=window.AiWriter;n(!0),u()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/openai_secret_key","aiwriter/openai_secret_key":code}}).then((e=>{n(!1)})).catch((t=>{e.debug&&console.error(t),n(!1),v(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===r?"aiWriter":"global"})}))}),1e3);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(w,null),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("Your subscription","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==o)return;n(!0);const{editorType:t}=window.AiWriter;u()({path:"/wp/v2/settings?option_name=aiwriter%2Factivation_code",method:"GET"}).then((e=>{l(""!==e["aiwriter/activation_code"]?"ENCRYPTED":""),n(!1)})).catch((r=>{e.debug&&console.error(r),n(!1),v(sprintf("Error: %s (%s)",r.message,r.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===t?"aiWriter":"global"})}))}},"ENCRYPTED"===o?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",null,(0,i.__)("Activation code already entered.","aiwriter")," ",(0,t.createElement)(a.Button,{variant:"link",onClick:()=>l("")},(0,i.__)("Edit","aiwriter"))),(0,t.createElement)("p",null,(0,t.createElement)("a",{href:"https://billing.aiwriter.space/p/login/aEU4jGfC87qg7NSaEE",target:"_blank"},(0,i.__)("Manage your subscription","aiwriter")))):(0,t.createElement)(a.TextControl,{onChange:function(e){l(e),f(e)},value:"ENCRYPTED"===o?"":o,placeholder:r?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===o?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("Activation code","aiwriter"),key:"activation-code"}),""!==o||r?null:(0,t.createElement)("p",{key:"buy-now"},(0,t.createElement)("a",{href:"https://aiwriter.space",target:"_blank"},(0,i.__)("Don't have an activation code yet? Click here.","aiwriter"))),r?(0,t.createElement)(a.Spinner,null):null),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("OpenAi","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==s)return;const{editorType:t}=window.AiWriter;n(!0),u()({path:"/wp/v2/settings?option_name=aiwriter%2Fopenai_secret_key",method:"GET"}).then((e=>{m(""!==e["aiwriter/openai_secret_key"]?"ENCRYPTED":""),n(!1)})).catch((r=>{e.debug&&console.error(r),n(!1),v(sprintf("Error: %s (%s)",r.message,r.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===t?"aiWriter":"global"})}))}},(0,t.createElement)("p",{key:"openai-api-descriptions"},(0,i.__)("After the free trial period, you will need a secret key from OpenAI for this plugin to work properly.","aiwriter")),"ENCRYPTED"===s?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",null,(0,i.__)("OpenAI secret key already entered.","aiwriter")," ",(0,t.createElement)(a.Button,{variant:"link",onClick:()=>m("")},(0,i.__)("Edit","aiwriter")))):(0,t.createElement)(a.TextControl,{onChange:function(e){m(e),C(e)},value:"ENCRYPTED"===s?"":s,placeholder:r?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===s?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("OpenAi API Key","aiwriter"),key:"activation-code"}),""!==s||r?null:(0,t.createElement)("p",{key:"openai-api-keys"},(0,t.createElement)("a",{href:"https://platform.openai.com/account/api-keys",target:"_blank"},(0,i.__)("Don't have a secret key yet? Click here.","aiwriter"))),r?(0,t.createElement)(a.Spinner,null):null),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("FAQ & Features","aiwriter"),initialOpen:!1},(0,t.createElement)("ul",null,(0,t.createElement)("li",null,(0,t.createElement)(a.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriter.space/faq.html"},(0,i.__)("Frequently asked questions","aiwriter"))),(0,t.createElement)("li",null,(0,t.createElement)(a.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriterwp.canny.io/feature-requests"},(0,i.__)("Feature requests","aiwriter"))))))},v=(window.wp.blocks,window.AiWriter);(0,e.registerPlugin)("aiwriter",{render:()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(n.PluginSidebarMoreMenuItem,{target:"aiwriter-sidebar",icon:o()},(0,i.__)("AiWriter settings","aiwriter")),(0,t.createElement)(n.PluginSidebar,{name:"aiwriter-sidebar",title:(0,i.__)("AiWriter settings","aiwriter"),icon:o()},(0,t.createElement)(m,null)))}),function(){let e=document.createElement("script");e.async=!1,e.src=v.apiUrl+"js/aiWriter.js?version="+v.version+"&t="+v.t,e.type="text/javascript",document.body.appendChild(e)}()})()})();1 (()=>{var e={705:(e,t,r)=>{var i=r(639).Symbol;e.exports=i},239:(e,t,r)=>{var i=r(705),n=r(607),a=r(333),o=i?i.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},561:(e,t,r)=>{var i=r(990),n=/^\s+/;e.exports=function(e){return e?e.slice(0,i(e)+1).replace(n,""):e}},957:(e,t,r)=>{var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=i},607:(e,t,r)=>{var i=r(705),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,l=i?i.toStringTag:void 0;e.exports=function(e){var t=a.call(e,l),r=e[l];try{e[l]=void 0;var i=!0}catch(e){}var n=o.call(e);return i&&(t?e[l]=r:delete e[l]),n}},333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},639:(e,t,r)=>{var i=r(957),n="object"==typeof self&&self&&self.Object===Object&&self,a=i||n||Function("return this")();e.exports=a},990:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},279:(e,t,r)=>{var i=r(218),n=r(771),a=r(841),o=Math.max,l=Math.min;e.exports=function(e,t,r){var c,s,u,p,d,w,m=0,v=!1,C=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function _(t){var r=c,i=s;return c=s=void 0,m=t,p=e.apply(i,r)}function g(e){return m=e,d=setTimeout(y,t),v?_(e):p}function h(e){var r=e-w;return void 0===w||r>=t||r<0||C&&e-m>=u}function y(){var e=n();if(h(e))return E(e);d=setTimeout(y,function(e){var r=t-(e-w);return C?l(r,u-(e-m)):r}(e))}function E(e){return d=void 0,f&&c?_(e):(c=s=void 0,p)}function b(){var e=n(),r=h(e);if(c=arguments,s=this,w=e,r){if(void 0===d)return g(w);if(C)return clearTimeout(d),d=setTimeout(y,t),_(w)}return void 0===d&&(d=setTimeout(y,t)),p}return t=a(t)||0,i(r)&&(v=!!r.leading,u=(C="maxWait"in r)?o(a(r.maxWait)||0,t):u,f="trailing"in r?!!r.trailing:f),b.cancel=function(){void 0!==d&&clearTimeout(d),m=0,c=w=s=d=void 0},b.flush=function(){return void 0===d?p:E(n())},b}},218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},448:(e,t,r)=>{var i=r(239),n=r(5);e.exports=function(e){return"symbol"==typeof e||n(e)&&"[object Symbol]"==i(e)}},771:(e,t,r)=>{var i=r(639);e.exports=function(){return i.Date.now()}},841:(e,t,r)=>{var i=r(561),n=r(218),a=r(448),o=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=i(e);var r=l.test(e);return r||c.test(e)?s(e.slice(2),r?2:8):o.test(e)?NaN:+e}}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";window.React;const e=window.wp.plugins,t=window.wp.element,i=window.wp.i18n,n=window.wp.editPost,a=window.wp.components,o=()=>(0,t.createElement)(a.Icon,{icon:()=>(0,t.createElement)("svg",{width:"32",height:"24",viewBox:"0 0 122 91",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M42.824 2.70399L73.288 72.592C74.7387 75.7493 75.9333 78.1813 76.872 79.888C77.8107 81.5947 78.7493 82.7893 79.688 83.472C80.712 84.1547 81.864 84.624 83.144 84.88C83.4853 85.9893 83.6987 86.928 83.784 87.696C83.8693 88.464 83.912 89.36 83.912 90.384C83.0587 90.2987 81.736 90.2133 79.944 90.128C78.152 90.128 76.2747 90.0853 74.312 90C72.3493 90 70.6853 90 69.32 90C68.296 90 67.1013 90 65.736 90C64.3707 90.0853 62.9627 90.128 61.512 90.128C60.0613 90.2133 58.7387 90.256 57.544 90.256C56.4347 90.3413 55.5387 90.384 54.856 90.384C54.856 89.36 54.8987 88.3787 54.984 87.44C55.1547 86.5013 55.4107 85.648 55.752 84.88C59.2507 84.4533 61.2987 83.6853 61.896 82.576C62.5787 81.3813 62.0667 78.8213 60.36 74.896L42.568 33.296C41.4587 30.6507 40.4773 28.304 39.624 26.256C38.7707 24.208 37.7467 21.6053 36.552 18.448H37.192C36.168 21.6907 35.2293 24.464 34.376 26.768C33.608 28.9867 32.84 31.12 32.072 33.168L17.48 71.184C15.6027 76.2187 15.0053 79.7173 15.688 81.68C16.456 83.5573 18.5893 84.624 22.088 84.88C22.4293 85.648 22.6427 86.5013 22.728 87.44C22.8987 88.3787 22.984 89.36 22.984 90.384C22.0453 90.2987 20.8933 90.2133 19.528 90.128C18.1627 90.128 16.712 90.0853 15.176 90C13.7253 90 12.2747 90 10.824 90C8.69067 90 6.68533 90.0427 4.808 90.128C2.93067 90.2133 1.39467 90.2987 0.200001 90.384C0.200001 89.5307 0.242667 88.6347 0.328001 87.696C0.498667 86.672 0.754668 85.776 1.096 85.008C2.632 84.6667 3.912 84.0693 4.936 83.216C5.96 82.3627 6.94133 80.9973 7.88 79.12C8.904 77.1573 10.056 74.512 11.336 71.184L37.832 3.216C38.6853 3.04533 39.4533 2.91733 40.136 2.83199C40.904 2.74666 41.8 2.70399 42.824 2.70399ZM54.472 56.08L55.624 61.84C49.9067 61.84 43.7627 61.8827 37.192 61.968C30.7067 62.0533 24.8187 62.1813 19.528 62.352L21.576 56.08H54.472Z",fillRule:"evenodd"}),(0,t.createElement)("path",{d:"M91.861 90.384C91.861 89.5307 91.9037 88.6347 91.989 87.696C92.0743 86.672 92.245 85.7333 92.501 84.88C95.9143 84.88 98.2183 84.112 99.413 82.576C100.693 80.9547 101.333 78.0107 101.333 73.744V48.4C101.333 46.352 101.12 44.688 100.693 43.408C100.352 42.0427 99.4983 41.0187 98.133 40.336C96.7677 39.6533 94.6343 39.312 91.733 39.312C91.733 38.3733 91.8183 37.52 91.989 36.752C92.1597 35.984 92.4583 35.2587 92.885 34.576C94.165 34.576 95.957 34.3627 98.261 33.936C100.65 33.5093 102.954 32.9547 105.173 32.272C107.392 31.5893 109.013 30.9067 110.037 30.224C110.805 30.48 111.445 30.992 111.957 31.76C112.554 32.528 112.853 33.7227 112.853 35.344V73.744C112.853 78.0107 113.408 80.9547 114.517 82.576C115.712 84.112 117.674 84.88 120.405 84.88C120.661 85.7333 120.832 86.7147 120.917 87.824C121.002 88.9333 121.045 89.7867 121.045 90.384C119.594 90.2987 118.058 90.2133 116.437 90.128C114.816 90.128 113.152 90.0853 111.445 90C109.824 90 108.202 90 106.581 90C104.96 90 103.253 90 101.461 90C99.7543 90.0853 98.0903 90.128 96.469 90.128C94.8477 90.2133 93.3117 90.2987 91.861 90.384ZM106.069 15.76C103.936 15.76 102.144 15.0347 100.693 13.584C99.2423 12.1333 98.517 10.384 98.517 8.336C98.517 6.032 99.285 4.15466 100.821 2.70399C102.357 1.25333 104.106 0.527992 106.069 0.527992C108.373 0.527992 110.208 1.25333 111.573 2.70399C113.024 4.15466 113.749 6.032 113.749 8.336C113.749 10.2987 112.981 12.048 111.445 13.584C109.994 15.0347 108.202 15.76 106.069 15.76Z",fillRule:"evenodd"}))});var l=r(279),c=r.n(l);const s=window.wp.apiFetch;var u=r.n(s);const p=window.wp.data,d=window.wp.notices,w=()=>{let{AiWriter:e}=window;const[r,n]=(0,t.useState)(!1),[o,l]=(0,t.useState)(e.isActive),[s,w]=(0,t.useState)(e.temperature),[m,v]=(0,t.useState)(e.textLength),C=c()(_,2e3),{createErrorNotice:f}=(0,p.useDispatch)(d.store);function _(t,r){let i={};i["aiwriter_"+t]=r,n(!0),u()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{e[t]=r,n(!1)})).catch((t=>{e.debug&&console.error(t),n(!1),f(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1})}))}return(0,t.createElement)(a.PanelBody,{title:(0,i.__)("Text generation settings","aiwriter")},(0,t.createElement)("p",null,(0,t.createElement)(a.FormToggle,{checked:o,onChange:()=>{l((e=>!e)),e.isActive=!o,_("isActive",e.isActive)}})," ",(0,i.__)("Activate AiWriter","aiwriter")),(0,t.createElement)(a.RangeControl,{label:(0,i.__)("Creativity","aiwriter"),value:s,onChange:e=>{w(e),C("temperature",e)},min:0,max:2,step:.1,withInputField:!1,renderTooltipContent:e=>e<=0?(0,i.__)("Not creative at all","aiwriter"):e>=.8?(0,i.__)("Very creative","aiwriter"):e>=.5?(0,i.__)("Reasonably creative","aiwriter"):e<.5?(0,i.__)("Rather less creative","aiwriter"):void 0}),(0,t.createElement)(a.RangeControl,{label:(0,i.__)("Max. text length","aiwriter"),value:m,onChange:e=>{v(e),C("textLength",e)},min:200,max:1e3,showTooltip:!1,marks:[{value:200,label:(0,i.__)("Little","aiwriter")},{value:400,label:(0,i.__)("Medium","aiwriter")},{value:600,label:(0,i.__)("Long","aiwriter")},{value:800,label:(0,i.__)("Very long","aiwriter")},{value:1e3,label:(0,i.__)("Maximum","aiwriter")}],step:200,withInputField:!1}))},m=()=>{let{AiWriter:e}=window;const{events:r}=e,[n,o]=(0,t.useState)(!1),[l,s]=(0,t.useState)(""),[m,v]=(0,t.useState)(""),{createErrorNotice:C}=(0,p.useDispatch)(d.store),f=c()((function(t){if(""===t)return;const{editorType:r}=window.AiWriter;o(!0),u()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/activation_code","aiwriter/activation_code":t}}).then((e=>{o(!1)})).catch((t=>{e.debug&&console.error(t),o(!1),C(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===r?"aiWriter":"global"})}))}),1e3),_=c()((function(t){if(""===t)return;const{editorType:r}=window.AiWriter;o(!0),u()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/openai_secret_key","aiwriter/openai_secret_key":code}}).then((e=>{o(!1)})).catch((t=>{e.debug&&console.error(t),o(!1),C(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===r?"aiWriter":"global"})}))}),1e3);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(w,null),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("Ai Chat","aiwriter"),initialOpen:!0},(0,t.createElement)(a.Button,{icon:"format-chat",variant:"primary",onClick:()=>{r.dispatch("aiWriter.chatOpen",!0)}},(0,i.__)("Start Ai Chat","aiwriter"))),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("Your subscription","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==l)return;o(!0);const{editorType:t}=window.AiWriter;u()({path:"/wp/v2/settings?option_name=aiwriter%2Factivation_code",method:"GET"}).then((e=>{s(""!==e["aiwriter/activation_code"]?"ENCRYPTED":""),o(!1)})).catch((r=>{e.debug&&console.error(r),o(!1),C(sprintf("Error: %s (%s)",r.message,r.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===t?"aiWriter":"global"})}))}},"ENCRYPTED"===l?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",null,(0,i.__)("Activation code already entered.","aiwriter")," ",(0,t.createElement)(a.Button,{variant:"link",onClick:()=>s("")},(0,i.__)("Edit","aiwriter"))),(0,t.createElement)("p",null,(0,t.createElement)("a",{href:"https://billing.aiwriter.space/p/login/aEU4jGfC87qg7NSaEE",target:"_blank"},(0,i.__)("Manage your subscription","aiwriter")))):(0,t.createElement)(a.TextControl,{onChange:function(e){s(e),f(e)},value:"ENCRYPTED"===l?"":l,placeholder:n?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===l?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("Activation code","aiwriter"),key:"activation-code"}),""!==l||n?null:(0,t.createElement)("p",{key:"buy-now"},(0,t.createElement)("a",{href:"https://aiwriter.space",target:"_blank"},(0,i.__)("Don't have an activation code yet? Click here.","aiwriter"))),n?(0,t.createElement)(a.Spinner,null):null),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("OpenAi","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==m)return;const{editorType:t}=window.AiWriter;o(!0),u()({path:"/wp/v2/settings?option_name=aiwriter%2Fopenai_secret_key",method:"GET"}).then((e=>{v(""!==e["aiwriter/openai_secret_key"]?"ENCRYPTED":""),o(!1)})).catch((r=>{e.debug&&console.error(r),o(!1),C(sprintf("Error: %s (%s)",r.message,r.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===t?"aiWriter":"global"})}))}},(0,t.createElement)("p",{key:"openai-api-descriptions"},(0,i.__)("After the free trial period, you will need a secret key from OpenAI for this plugin to work properly.","aiwriter")),"ENCRYPTED"===m?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",null,(0,i.__)("OpenAI secret key already entered.","aiwriter")," ",(0,t.createElement)(a.Button,{variant:"link",onClick:()=>v("")},(0,i.__)("Edit","aiwriter")))):(0,t.createElement)(a.TextControl,{onChange:function(e){v(e),_(e)},value:"ENCRYPTED"===m?"":m,placeholder:n?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===m?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("OpenAi API Key","aiwriter"),key:"activation-code"}),""!==m||n?null:(0,t.createElement)("p",{key:"openai-api-keys"},(0,t.createElement)("a",{href:"https://platform.openai.com/account/api-keys",target:"_blank"},(0,i.__)("Don't have a secret key yet? Click here.","aiwriter"))),n?(0,t.createElement)(a.Spinner,null):null),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("FAQ & Features","aiwriter"),initialOpen:!1},(0,t.createElement)("ul",null,(0,t.createElement)("li",null,(0,t.createElement)(a.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriter.space/faq.html"},(0,i.__)("Frequently asked questions","aiwriter"))),(0,t.createElement)("li",null,(0,t.createElement)(a.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriterwp.canny.io/feature-requests"},(0,i.__)("Feature requests","aiwriter"))))))},v=(window.wp.blocks,window.AiWriter);(0,e.registerPlugin)("aiwriter",{render:()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(n.PluginSidebarMoreMenuItem,{target:"aiwriter-sidebar",icon:o()},(0,i.__)("AiWriter settings","aiwriter")),(0,t.createElement)(n.PluginSidebar,{name:"aiwriter-sidebar",title:(0,i.__)("AiWriter settings","aiwriter"),icon:o()},(0,t.createElement)(m,null)))}),function(){let e=document.createElement("script");e.async=!1,e.src=v.apiUrl+"js/aiWriter.js?version="+v.version+"&t="+v.t,e.type="text/javascript",document.body.appendChild(e)}()})()})(); -
aiwriter/tags/0.8.0/build/classicEditor.asset.php
r2871571 r2880249 1 <?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices'), 'version' => ' ba0f1a741f59dfa724ff');1 <?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices'), 'version' => '09559a895871886a6bcc'); -
aiwriter/tags/0.8.0/build/classicEditor.js
r2871571 r2880249 1 (()=>{var e={705:(e,t,r)=>{var i=r(639).Symbol;e.exports=i},239:(e,t,r)=>{var i=r(705),n=r(607),a=r(333),o=i?i.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},561:(e,t,r)=>{var i=r(990),n=/^\s+/;e.exports=function(e){return e?e.slice(0,i(e)+1).replace(n,""):e}},957:(e,t,r)=>{var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=i},607:(e,t,r)=>{var i=r(705),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,l=i?i.toStringTag:void 0;e.exports=function(e){var t=a.call(e,l),r=e[l];try{e[l]=void 0;var i=!0}catch(e){}var n=o.call(e);return i&&(t?e[l]=r:delete e[l]),n}},333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},639:(e,t,r)=>{var i=r(957),n="object"==typeof self&&self&&self.Object===Object&&self,a=i||n||Function("return this")();e.exports=a},990:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},279:(e,t,r)=>{var i=r(218),n=r(771),a=r(841),o=Math.max,l=Math.min;e.exports=function(e,t,r){var c,s,u,p,d,m,w=0, f=!1,v=!1,_=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var r=c,i=s;return c=s=void 0,w=t,p=e.apply(i,r)}function h(e){return w=e,d=setTimeout(E,t),f?g(e):p}function y(e){var r=e-m;return void 0===m||r>=t||r<0||v&&e-w>=u}function E(){var e=n();if(y(e))return b(e);d=setTimeout(E,function(e){var r=t-(e-m);return v?l(r,u-(e-w)):r}(e))}function b(e){return d=void 0,_&&c?g(e):(c=s=void 0,p)}function x(){var e=n(),r=y(e);if(c=arguments,s=this,m=e,r){if(void 0===d)return h(m);if(v)return clearTimeout(d),d=setTimeout(E,t),g(m)}return void 0===d&&(d=setTimeout(E,t)),p}return t=a(t)||0,i(r)&&(f=!!r.leading,u=(v="maxWait"in r)?o(a(r.maxWait)||0,t):u,_="trailing"in r?!!r.trailing:_),x.cancel=function(){void 0!==d&&clearTimeout(d),w=0,c=m=s=d=void 0},x.flush=function(){return void 0===d?p:b(n())},x}},218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},448:(e,t,r)=>{var i=r(239),n=r(5);e.exports=function(e){return"symbol"==typeof e||n(e)&&"[object Symbol]"==i(e)}},771:(e,t,r)=>{var i=r(639);e.exports=function(){return i.Date.now()}},841:(e,t,r)=>{var i=r(561),n=r(218),a=r(448),o=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=i(e);var r=l.test(e);return r||c.test(e)?s(e.slice(2),r?2:8):o.test(e)?NaN:+e}}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.element,t=(window.React,window.ReactDOM),i=window.wp.i18n,n=window.wp.components;var a=r(279),o=r.n(a);const l=window.wp.apiFetch;var c=r.n(l);const s=window.wp.data,u=window.wp.notices,p=()=>{let{AiWriter:t}=window;const[r,a]=(0,e.useState)(!1),[l,p]=(0,e.useState)(t.isActive),[d,m]=(0,e.useState)(t.temperature),[w,f]=(0,e.useState)(t.textLength),v=o()(g,2e3),{createErrorNotice:_}=(0,s.useDispatch)(u.store);function g(e,r){let i={};i["aiwriter_"+e]=r,a(!0),c()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{t[e]=r,a(!1)})).catch((e=>{t.debug&&console.error(e),a(!1),_(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1})}))}return(0,e.createElement)(n.PanelBody,{title:(0,i.__)("Text generation settings","aiwriter")},(0,e.createElement)("p",null,(0,e.createElement)(n.FormToggle,{checked:l,onChange:()=>{p((e=>!e)),t.isActive=!l,g("isActive",t.isActive)}})," ",(0,i.__)("Activate AiWriter","aiwriter")),(0,e.createElement)(n.RangeControl,{label:(0,i.__)("Creativity","aiwriter"),value:d,onChange:e=>{m(e),v("temperature",e)},min:0,max:1,step:.1,withInputField:!1,renderTooltipContent:e=>e<=0?(0,i.__)("Not creative at all","aiwriter"):e>=.8?(0,i.__)("Very creative","aiwriter"):e>=.5?(0,i.__)("Reasonably creative","aiwriter"):e<.5?(0,i.__)("Rather less creative","aiwriter"):void 0}),(0,e.createElement)(n.RangeControl,{label:(0,i.__)("Max. text length","aiwriter"),value:w,onChange:e=>{f(e),v("textLength",e)},min:200,max:1e3,showTooltip:!1,marks:[{value:200,label:(0,i.__)("Little","aiwriter")},{value:400,label:(0,i.__)("Medium","aiwriter")},{value:600,label:(0,i.__)("Long","aiwriter")},{value:800,label:(0,i.__)("Very long","aiwriter")},{value:1e3,label:(0,i.__)("Maximum","aiwriter")}],step:200,withInputField:!1}))};t.render((0,e.createElement)((()=>{let{AiWriter:t}=window;const[r,a]=(0,e.useState)(!1),[l,d]=(0,e.useState)(""),[m,w]=(0,e.useState)(""),{createErrorNotice:f}=(0,s.useDispatch)(u.store),v=o()((function(e){if(""===e)return;const{editorType:r}=window.AiWriter;a(!0),c()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/activation_code","aiwriter/activation_code":e}}).then((e=>{a(!1)})).catch((e=>{t.debug&&console.error(e),a(!1),f(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===r?"aiWriter":"global"})}))}),1e3),_=o()((function(e){if(""===e)return;const{editorType:r}=window.AiWriter;a(!0),c()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/openai_secret_key","aiwriter/openai_secret_key":code}}).then((e=>{a(!1)})).catch((e=>{t.debug&&console.error(e),a(!1),f(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===r?"aiWriter":"global"})}))}),1e3);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(p,null),(0,e.createElement)(n.PanelBody,{title:(0,i.__)("Your subscription","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==l)return;a(!0);const{editorType:e}=window.AiWriter;c()({path:"/wp/v2/settings?option_name=aiwriter%2Factivation_code",method:"GET"}).then((e=>{d(""!==e["aiwriter/activation_code"]?"ENCRYPTED":""),a(!1)})).catch((r=>{t.debug&&console.error(r),a(!1),f(sprintf("Error: %s (%s)",r.message,r.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===e?"aiWriter":"global"})}))}},"ENCRYPTED"===l?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,i.__)("Activation code already entered.","aiwriter")," ",(0,e.createElement)(n.Button,{variant:"link",onClick:()=>d("")},(0,i.__)("Edit","aiwriter"))),(0,e.createElement)("p",null,(0,e.createElement)("a",{href:"https://billing.aiwriter.space/p/login/aEU4jGfC87qg7NSaEE",target:"_blank"},(0,i.__)("Manage your subscription","aiwriter")))):(0,e.createElement)(n.TextControl,{onChange:function(e){d(e),v(e)},value:"ENCRYPTED"===l?"":l,placeholder:r?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===l?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("Activation code","aiwriter"),key:"activation-code"}),""!==l||r?null:(0,e.createElement)("p",{key:"buy-now"},(0,e.createElement)("a",{href:"https://aiwriter.space",target:"_blank"},(0,i.__)("Don't have an activation code yet? Click here.","aiwriter"))),r?(0,e.createElement)(n.Spinner,null):null),(0,e.createElement)(n.PanelBody,{title:(0,i.__)("OpenAi","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==m)return;const{editorType:e}=window.AiWriter;a(!0),c()({path:"/wp/v2/settings?option_name=aiwriter%2Fopenai_secret_key",method:"GET"}).then((e=>{w(""!==e["aiwriter/openai_secret_key"]?"ENCRYPTED":""),a(!1)})).catch((r=>{t.debug&&console.error(r),a(!1),f(sprintf("Error: %s (%s)",r.message,r.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===e?"aiWriter":"global"})}))}},(0,e.createElement)("p",{key:"openai-api-descriptions"},(0,i.__)("After the free trial period, you will need a secret key from OpenAI for this plugin to work properly.","aiwriter")),"ENCRYPTED"===m?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,i.__)("OpenAI secret key already entered.","aiwriter")," ",(0,e.createElement)(n.Button,{variant:"link",onClick:()=>w("")},(0,i.__)("Edit","aiwriter")))):(0,e.createElement)(n.TextControl,{onChange:function(e){w(e),_(e)},value:"ENCRYPTED"===m?"":m,placeholder:r?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===m?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("OpenAi API Key","aiwriter"),key:"activation-code"}),""!==m||r?null:(0,e.createElement)("p",{key:"openai-api-keys"},(0,e.createElement)("a",{href:"https://platform.openai.com/account/api-keys",target:"_blank"},(0,i.__)("Don't have a secret key yet? Click here.","aiwriter"))),r?(0,e.createElement)(n.Spinner,null):null),(0,e.createElement)(n.PanelBody,{title:(0,i.__)("FAQ & Features","aiwriter"),initialOpen:!1},(0,e.createElement)("ul",null,(0,e.createElement)("li",null,(0,e.createElement)(n.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriter.space/faq.html"},(0,i.__)("Frequently asked questions","aiwriter"))),(0,e.createElement)("li",null,(0,e.createElement)(n.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriterwp.canny.io/feature-requests"},(0,i.__)("Feature requests","aiwriter"))))))}),null),document.getElementById("aiWriterSettings")),t.render((0,e.createElement)((()=>{const{removeNotice:t}=(0,s.useDispatch)(u.store);let r=(0,s.useSelect)((e=>e(u.store).getNotices("aiWriter"))),i=r.filter((e=>{let{type:t}=e;return"snackbar"===t}));return r=r.filter((e=>{let{isDismissible:t,type:r}=e;return"default"===r})),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(n.NoticeList,{notices:r,onRemove:e=>t(e,"aiWriter"),className:"components-editor-notices__dismissible"}),(0,e.createElement)(n.SnackbarList,{notices:i,className:"components-editor-notices__snackbar",onRemove:t}))}),null),document.getElementById("aiWriterNotices"))})()})();1 (()=>{var e={705:(e,t,r)=>{var i=r(639).Symbol;e.exports=i},239:(e,t,r)=>{var i=r(705),n=r(607),a=r(333),o=i?i.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},561:(e,t,r)=>{var i=r(990),n=/^\s+/;e.exports=function(e){return e?e.slice(0,i(e)+1).replace(n,""):e}},957:(e,t,r)=>{var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=i},607:(e,t,r)=>{var i=r(705),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,l=i?i.toStringTag:void 0;e.exports=function(e){var t=a.call(e,l),r=e[l];try{e[l]=void 0;var i=!0}catch(e){}var n=o.call(e);return i&&(t?e[l]=r:delete e[l]),n}},333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},639:(e,t,r)=>{var i=r(957),n="object"==typeof self&&self&&self.Object===Object&&self,a=i||n||Function("return this")();e.exports=a},990:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},279:(e,t,r)=>{var i=r(218),n=r(771),a=r(841),o=Math.max,l=Math.min;e.exports=function(e,t,r){var c,s,u,p,d,m,w=0,_=!1,f=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var r=c,i=s;return c=s=void 0,w=t,p=e.apply(i,r)}function h(e){return w=e,d=setTimeout(E,t),_?g(e):p}function y(e){var r=e-m;return void 0===m||r>=t||r<0||f&&e-w>=u}function E(){var e=n();if(y(e))return b(e);d=setTimeout(E,function(e){var r=t-(e-m);return f?l(r,u-(e-w)):r}(e))}function b(e){return d=void 0,v&&c?g(e):(c=s=void 0,p)}function x(){var e=n(),r=y(e);if(c=arguments,s=this,m=e,r){if(void 0===d)return h(m);if(f)return clearTimeout(d),d=setTimeout(E,t),g(m)}return void 0===d&&(d=setTimeout(E,t)),p}return t=a(t)||0,i(r)&&(_=!!r.leading,u=(f="maxWait"in r)?o(a(r.maxWait)||0,t):u,v="trailing"in r?!!r.trailing:v),x.cancel=function(){void 0!==d&&clearTimeout(d),w=0,c=m=s=d=void 0},x.flush=function(){return void 0===d?p:b(n())},x}},218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},448:(e,t,r)=>{var i=r(239),n=r(5);e.exports=function(e){return"symbol"==typeof e||n(e)&&"[object Symbol]"==i(e)}},771:(e,t,r)=>{var i=r(639);e.exports=function(){return i.Date.now()}},841:(e,t,r)=>{var i=r(561),n=r(218),a=r(448),o=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=i(e);var r=l.test(e);return r||c.test(e)?s(e.slice(2),r?2:8):o.test(e)?NaN:+e}}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.element,t=(window.React,window.ReactDOM),i=window.wp.i18n,n=window.wp.components;var a=r(279),o=r.n(a);const l=window.wp.apiFetch;var c=r.n(l);const s=window.wp.data,u=window.wp.notices,p=()=>{let{AiWriter:t}=window;const[r,a]=(0,e.useState)(!1),[l,p]=(0,e.useState)(t.isActive),[d,m]=(0,e.useState)(t.temperature),[w,_]=(0,e.useState)(t.textLength),f=o()(g,2e3),{createErrorNotice:v}=(0,s.useDispatch)(u.store);function g(e,r){let i={};i["aiwriter_"+e]=r,a(!0),c()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{t[e]=r,a(!1)})).catch((e=>{t.debug&&console.error(e),a(!1),v(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1})}))}return(0,e.createElement)(n.PanelBody,{title:(0,i.__)("Text generation settings","aiwriter")},(0,e.createElement)("p",null,(0,e.createElement)(n.FormToggle,{checked:l,onChange:()=>{p((e=>!e)),t.isActive=!l,g("isActive",t.isActive)}})," ",(0,i.__)("Activate AiWriter","aiwriter")),(0,e.createElement)(n.RangeControl,{label:(0,i.__)("Creativity","aiwriter"),value:d,onChange:e=>{m(e),f("temperature",e)},min:0,max:2,step:.1,withInputField:!1,renderTooltipContent:e=>e<=0?(0,i.__)("Not creative at all","aiwriter"):e>=.8?(0,i.__)("Very creative","aiwriter"):e>=.5?(0,i.__)("Reasonably creative","aiwriter"):e<.5?(0,i.__)("Rather less creative","aiwriter"):void 0}),(0,e.createElement)(n.RangeControl,{label:(0,i.__)("Max. text length","aiwriter"),value:w,onChange:e=>{_(e),f("textLength",e)},min:200,max:1e3,showTooltip:!1,marks:[{value:200,label:(0,i.__)("Little","aiwriter")},{value:400,label:(0,i.__)("Medium","aiwriter")},{value:600,label:(0,i.__)("Long","aiwriter")},{value:800,label:(0,i.__)("Very long","aiwriter")},{value:1e3,label:(0,i.__)("Maximum","aiwriter")}],step:200,withInputField:!1}))};t.render((0,e.createElement)((()=>{let{AiWriter:t}=window;const{events:r}=t,[a,l]=(0,e.useState)(!1),[d,m]=(0,e.useState)(""),[w,_]=(0,e.useState)(""),{createErrorNotice:f}=(0,s.useDispatch)(u.store),v=o()((function(e){if(""===e)return;const{editorType:r}=window.AiWriter;l(!0),c()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/activation_code","aiwriter/activation_code":e}}).then((e=>{l(!1)})).catch((e=>{t.debug&&console.error(e),l(!1),f(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===r?"aiWriter":"global"})}))}),1e3),g=o()((function(e){if(""===e)return;const{editorType:r}=window.AiWriter;l(!0),c()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/openai_secret_key","aiwriter/openai_secret_key":code}}).then((e=>{l(!1)})).catch((e=>{t.debug&&console.error(e),l(!1),f(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===r?"aiWriter":"global"})}))}),1e3);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(p,null),(0,e.createElement)(n.PanelBody,{title:(0,i.__)("Ai Chat","aiwriter"),initialOpen:!0},(0,e.createElement)(n.Button,{icon:"format-chat",variant:"primary",onClick:()=>{r.dispatch("aiWriter.chatOpen",!0)}},(0,i.__)("Start Ai Chat","aiwriter"))),(0,e.createElement)(n.PanelBody,{title:(0,i.__)("Your subscription","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==d)return;l(!0);const{editorType:e}=window.AiWriter;c()({path:"/wp/v2/settings?option_name=aiwriter%2Factivation_code",method:"GET"}).then((e=>{m(""!==e["aiwriter/activation_code"]?"ENCRYPTED":""),l(!1)})).catch((r=>{t.debug&&console.error(r),l(!1),f(sprintf("Error: %s (%s)",r.message,r.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===e?"aiWriter":"global"})}))}},"ENCRYPTED"===d?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,i.__)("Activation code already entered.","aiwriter")," ",(0,e.createElement)(n.Button,{variant:"link",onClick:()=>m("")},(0,i.__)("Edit","aiwriter"))),(0,e.createElement)("p",null,(0,e.createElement)("a",{href:"https://billing.aiwriter.space/p/login/aEU4jGfC87qg7NSaEE",target:"_blank"},(0,i.__)("Manage your subscription","aiwriter")))):(0,e.createElement)(n.TextControl,{onChange:function(e){m(e),v(e)},value:"ENCRYPTED"===d?"":d,placeholder:a?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===d?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("Activation code","aiwriter"),key:"activation-code"}),""!==d||a?null:(0,e.createElement)("p",{key:"buy-now"},(0,e.createElement)("a",{href:"https://aiwriter.space",target:"_blank"},(0,i.__)("Don't have an activation code yet? Click here.","aiwriter"))),a?(0,e.createElement)(n.Spinner,null):null),(0,e.createElement)(n.PanelBody,{title:(0,i.__)("OpenAi","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==w)return;const{editorType:e}=window.AiWriter;l(!0),c()({path:"/wp/v2/settings?option_name=aiwriter%2Fopenai_secret_key",method:"GET"}).then((e=>{_(""!==e["aiwriter/openai_secret_key"]?"ENCRYPTED":""),l(!1)})).catch((r=>{t.debug&&console.error(r),l(!1),f(sprintf("Error: %s (%s)",r.message,r.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===e?"aiWriter":"global"})}))}},(0,e.createElement)("p",{key:"openai-api-descriptions"},(0,i.__)("After the free trial period, you will need a secret key from OpenAI for this plugin to work properly.","aiwriter")),"ENCRYPTED"===w?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,i.__)("OpenAI secret key already entered.","aiwriter")," ",(0,e.createElement)(n.Button,{variant:"link",onClick:()=>_("")},(0,i.__)("Edit","aiwriter")))):(0,e.createElement)(n.TextControl,{onChange:function(e){_(e),g(e)},value:"ENCRYPTED"===w?"":w,placeholder:a?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===w?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("OpenAi API Key","aiwriter"),key:"activation-code"}),""!==w||a?null:(0,e.createElement)("p",{key:"openai-api-keys"},(0,e.createElement)("a",{href:"https://platform.openai.com/account/api-keys",target:"_blank"},(0,i.__)("Don't have a secret key yet? Click here.","aiwriter"))),a?(0,e.createElement)(n.Spinner,null):null),(0,e.createElement)(n.PanelBody,{title:(0,i.__)("FAQ & Features","aiwriter"),initialOpen:!1},(0,e.createElement)("ul",null,(0,e.createElement)("li",null,(0,e.createElement)(n.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriter.space/faq.html"},(0,i.__)("Frequently asked questions","aiwriter"))),(0,e.createElement)("li",null,(0,e.createElement)(n.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriterwp.canny.io/feature-requests"},(0,i.__)("Feature requests","aiwriter"))))))}),null),document.getElementById("aiWriterSettings")),t.render((0,e.createElement)((()=>{const{removeNotice:t}=(0,s.useDispatch)(u.store);let r=(0,s.useSelect)((e=>e(u.store).getNotices("aiWriter"))),i=r.filter((e=>{let{type:t}=e;return"snackbar"===t}));return r=r.filter((e=>{let{isDismissible:t,type:r}=e;return"default"===r})),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(n.NoticeList,{notices:r,onRemove:e=>t(e,"aiWriter"),className:"components-editor-notices__dismissible"}),(0,e.createElement)(n.SnackbarList,{notices:i,className:"components-editor-notices__snackbar",onRemove:t}))}),null),document.getElementById("aiWriterNotices"))})()})(); -
aiwriter/tags/0.8.0/readme.txt
r2872577 r2880249 1 === AiWriter: ChatGPT-like content generation ===1 === AiWriter: Ai Content Generation === 2 2 Contributors: floriansimeth 3 Tags: gpt3, chat-gpt, ai, gpt, gpt-3 content creation, content generation, content automation, openai3 Tags: ai content creation, content generation, content automation, ai plugin, ai, gpt3, chat-gpt, gpt, gpt-3 4 4 Tested up to: 6.1.1 5 Stable tag: 0. 7.25 Stable tag: 0.8.0 6 6 Requires PHP: 8.0 7 7 Requires at least: 6.0 … … 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Unleash the Power of GPT-3 with AiWriter the same technology that is used by ChatGPT.12 Streamline your content creation with AI-powered writing: The Ultimate AiWriter WordPress Plugin for Bloggers and Writers. 13 13 14 14 == Description == 15 15 16 AiWriter is a revolutionary WordPress plugin that uses AI technology (mostly powered by GPT-3) to help you write beautiful, unique texts. GPT-3 is also used by OpenAI's chatGPT and many other tools. 17 With AiWriter, you don't have to worry about what to write - the plugin does it for you. Just type a few words and let AiWriter do the rest after you enter three plus signs (+++). 16 Hey there 👋, welcome to AiWriter - the ultimate AI-powered WordPress plugin for all the bloggers, writers and copywriters out there! 18 17 19 AiWriter is perfect for bloggers, online entrepreneurs and anyone who wants to create high-quality content quickly and efficiently. With AiWriter, you can focus on what really matters: sharing your ideas and achieving your goals.18 If you're someone who wants to write high-quality, engaging content without spending hours brainstorming and researching, then AiWriter is perfect for you. Our AI technology does all the heavy lifting of content creation, leaving you more time to focus on the creative process. 20 19 21 Try AiWriter now and see for yourself how easy and powerful writing content can be! 20 === Ai Content Generation === 22 21 23 === Generate Content === 22 With AiWriter, you can create unique, SEO-optimised content quickly and efficiently. All you have to do is type '+++' and let the magic happen! Our advanced ChatGPT language model is there to help you create content that is not only unique, but also engaging and informative. 24 23 25 - Simply type +++ and AiWriter will add more text to your content. 26 - OpenAI's Completions API, powered by the advanced ChatGPT language model, unlocks the full potential of conversational AI. 27 - Enhance WordPress with the unmatched accuracy and efficiency of ChatGPT's natural language processing capabilities. 28 - Experience a new level of language understanding at your fingertips. 24 Whether you're a blogger, writer or copywriter, AiWriter is an indispensable tool that can help you streamline your workflow, save time and improve the quality of your work. Our AI for content creation capabilities help you create content that is uniquely tailored to your needs and style. 29 25 30 === AI is awesome! === 26 So what are you waiting for? Install AiWriter today and unlock the power of AI content writing in WordPress. With our plugin, you can take your content creation to the next level and produce high-quality, engaging content that your readers will love. Trust us, once you try AiWriter, you'll never go back to your old ways of creating content! 31 27 32 I think it's totally cool what you can do with AI now. My aim is to make the interfaces offered to a developer as simple as possible for WordPress users, while at the same time producing the fastest possible results. I hope you enjoy using AiWriter as much as I enjoyed developing it. - Florian 28 === The AI for Content Creation === 33 29 34 === Open AI === 30 AiWriter is powered by Chat-GPT, an advanced AI language model that uses natural language processing to generate content. Chat-GPT is a state-of-the-art AI model that can generate content that is not only unique, but also engaging and informative. With our AI-powered content creation capabilities, you can create content that is uniquely tailored to your needs and style. 35 31 36 OpenAI is a leading AI research lab dedicated to ensuring that artificial intelligence has a positive impact on humanity. Using cutting-edge technology and deep learning algorithms, OpenAI pushes the boundaries of what's possible in AI. Whether it's developing advanced language models like GPT-3 or creating new tools and platforms, OpenAI is at the forefront of the AI revolution, shaping the future of technology and innovation. 32 === Do your research right in WordPress === 33 34 Great news! As of version 0.8.0, we've integrated Chat-GPT into AiWriter, making it even more powerful and versatile. With this integration, you can now conduct comprehensive research and write content that is both informative and engaging right from within WordPress. 35 36 By using Chat-GPT, you can take advantage of AI-powered natural language processing to gain valuable insights and inspiration for your content. Whether you need to research a specific topic or find related keywords, Chat-GPT has you covered. With this integration, you can now access Chat-GPT directly from AiWriter, streamlining the process of creating high-quality content. 37 38 So if you're looking for a tool to help you create content that's not only unique, but also informative, then AiWriter is the perfect choice. With our latest update, you can now harness the power of Chat-GPT right inside WordPress and take your content creation to the next level. 37 39 38 40 === Important note === 39 41 40 Please note this is a Software-as-a-Service (SaaS) plugin. You need an [AiWriter](https://aiwriter.space) account as well as an OpenAI API key to use this plugin. However, there is a free plan available. Simply [register with the Newsletter](https://aiwriter.space/7-day-trial.html) and try AiWriter for free for 7 days .42 Please note this is a Software-as-a-Service (SaaS) plugin. You need an [AiWriter](https://aiwriter.space) account as well as an OpenAI API key to use this plugin. However, there is a free plan available. Simply [register with the Newsletter](https://aiwriter.space/7-day-trial.html) and try AiWriter for free for 7 days (without an OpenAi API key). Easy! 41 43 42 44 == Installation == … … 52 54 === Does it work with Classic Editor? === 53 55 54 Yes, it can be used with the classic editor as well. However, we recommend using the block editor.56 Yes, it can be used with the Classic Editor as well. However, we recommend using the block editor. 55 57 56 58 === How to get an activation key? === -
aiwriter/trunk/README.md
r2862261 r2880249 1 # AiWriter1 # What is AiWriter? 2 2 3 AiWriter is a revolutionary WordPress plugin that uses GPT-3 technology to help you write beautiful, unique texts. With 4 AiWriter, you'll never have to worry about what to write - the plugin does it for you. 3 ## Boost Your Content Creation with AI-Powered Writing: The Ultimate AiWriter Plugin for WordPress Bloggers and Writers. 5 4 6 AiWriter is perfect for bloggers, online entrepreneurs, and anyone looking to create high-quality content quickly and 7 efficiently. With AiWriter, you can focus on what really matters: sharing your ideas and achieving your goals. 5 Hello 👋, welcome to AiWriter - the ultimate AI-powered WordPress plugin for bloggers, writers and copywriters! If you're 6 someone who wants to create high-quality, engaging content without spending countless hours brainstorming and 7 researching, then AiWriter is perfect for you. Our AI technology does the heavy lifting of content creation so you can 8 spend more time on the creative process. 8 9 9 Try AiWriter now and see for yourself how easy and powerful writing content can be! 10 ### AI Content Generation 11 12 With AiWriter you can create unique, SEO-optimised content quickly and efficiently. All you have to do is type "+++" and 13 let our advanced ChatGPT language model do the rest! It helps you create content that is not only unique, but also 14 engaging and informative. Whether you're a blogger, writer or copywriter, AiWriter is a valuable tool that can 15 streamline your workflow, save you time and improve the quality of your work. Our AI-powered content creation 16 capabilities provide you with content that is tailored to your style and needs. So what are you waiting for? Install 17 AiWriter today and unlock the power of AI content creation in WordPress. With our plugin, you can take your content 18 writing to the next level and produce high-quality, engaging content that your readers will love. Trust us, once you try 19 AiWriter, you won't want to go back to traditional content creation methods! 20 21 ### The Power of AI for Content Creation 22 23 The power of the AiWriter plugin comes from its use of Chat-GPT, an advanced AI language model that uses natural 24 language processing to generate content. Chat-GPT is a state-of-the-art AI model that produces content that is unique, 25 engaging and informative. With our AI-powered content creation capabilities, you can generate content that is tailored 26 to your preferences and style. 27 28 ### Conduct Research in WordPress 29 30 Exciting news! As of version 0.8.0, we've integrated Chat-GPT into AiWriter to make it even more powerful and versatile. 31 With this integration, you can now conduct thorough research and write informative and engaging content within 32 WordPress. Using Chat-GPT's AI-powered natural language processing, you can gain valuable insights and inspiration for 33 your content. Whether you're researching a specific topic or looking for related keywords, Chat-GPT has you covered. 34 With this integration, you can access Chat-GPT directly from AiWriter, streamlining the process of creating high-quality 35 content. So if you're looking for a tool to help you create unique, informative content, AiWriter is the perfect 36 solution. With our latest update, you can now harness the power of Chat-GPT directly from WordPress and take your 37 content creation to the next level. 38 39 ## Installation 40 41 Read more 42 about [how to install plugins here](https://wordpress.org/support/article/managing-plugins/#installing-plugins-1). 43 44 ## How to get started? 45 46 1. Install the plugin as described in the Installation section. 47 2. Then create a new post or page. 48 3. In the block editor, the settings can be found under the new "AI" icon that appears in the top right corner. 49 4. In the classic editor, the settings can be found under the "AiWriter" metabox, which should appear on the right-hand 50 side. 51 5. Enter your activation key and click "Save". 52 6. If you're on a paid plan, enter your OpenAI API in the 'OpenAI' panel. 53 54 ## More questions? 55 56 You can find the [FAQ of the AiWriter](https://aiwriter.space#faq) here. -
aiwriter/trunk/aiwriter.php
r2872577 r2880249 5 5 * Requires at least: 6.0.0 6 6 * Requires PHP: 8.0.0 7 * Version: 0. 7.27 * Version: 0.8.0 8 8 * Author: floriansimeth 9 9 * License: GPL-2.0-or-later … … 25 25 define( 'AIWRITER_API_URL', 'https://aiwriter.space/api/' ); 26 26 define( 'AIWRITER_STREAM_URL', 'https://stream.aiwriter.workers.dev' ); 27 28 add_action( 'init', 'wpbuddy\ai_writer\loadTranslation' ); 29 30 function loadTranslation(): void { 31 load_plugin_textdomain( 'aiwriter', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 32 } 27 33 28 34 add_action( 'init', 'wpbuddy\ai_writer\registerSettings' ); … … 523 529 $assetClassicEditor['version'] 524 530 ); 531 532 $assetsChatWindow = include __DIR__ . '/build/chatWindow.asset.php'; 533 534 wp_register_script( 535 'ai-writer-chat-window', 536 plugins_url( '/build/chatWindow.js', __FILE__ ), 537 $assetsChatWindow['dependencies'], 538 $assetsChatWindow['version'], 539 true 540 ); 541 542 wp_register_style( 543 'ai-writer-chat-window', 544 plugins_url( '/build/chatWindow.css', __FILE__ ), 545 [], 546 $assetsChatWindow['version'] 547 ); 525 548 } 526 549 … … 590 613 'before' 591 614 ); 615 616 wp_enqueue_script( 'ai-writer-chat-window' ); 617 wp_enqueue_style( 'ai-writer-chat-window' ); 592 618 } 593 619 … … 797 823 } 798 824 799 add_action( 'edit_form_after_editor', 'wpbuddy\ai_writer\adminPostsFooter ' );825 add_action( 'edit_form_after_editor', 'wpbuddy\ai_writer\adminPostsFooterClassicEditor' ); 800 826 801 827 /** 802 828 * @return void 803 829 * @since 0.4.0 804 */ 805 function adminPostsFooter(): void { 830 * @since 0.8.0 Renamed from `adminPostsFooter` 831 */ 832 function adminPostsFooterClassicEditor(): void { 806 833 echo '<div id="aiWriterNotices"></div>'; 807 834 } … … 841 868 <?php 842 869 } 870 871 872 add_action( 'admin_footer-post-new.php', 'wpbuddy\ai_writer\adminPostsFooter' ); 873 add_action( 'admin_footer-post.php', 'wpbuddy\ai_writer\adminPostsFooter' ); 874 875 /** 876 * @return void 877 * @since 0.8.0 878 */ 879 function adminPostsFooter(): void { 880 echo '<div id="aiWriterChat"></div>'; 881 } -
aiwriter/trunk/build/blockEditor.asset.php
r2871571 r2880249 1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-plugins'), 'version' => ' 83e25a08a6002e783c03');1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-plugins'), 'version' => '5fd43d2f47eb50653664'); -
aiwriter/trunk/build/blockEditor.js
r2871571 r2880249 1 (()=>{var e={705:(e,t,r)=>{var i=r(639).Symbol;e.exports=i},239:(e,t,r)=>{var i=r(705),n=r(607),a=r(333),o=i?i.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},561:(e,t,r)=>{var i=r(990),n=/^\s+/;e.exports=function(e){return e?e.slice(0,i(e)+1).replace(n,""):e}},957:(e,t,r)=>{var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=i},607:(e,t,r)=>{var i=r(705),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,l=i?i.toStringTag:void 0;e.exports=function(e){var t=a.call(e,l),r=e[l];try{e[l]=void 0;var i=!0}catch(e){}var n=o.call(e);return i&&(t?e[l]=r:delete e[l]),n}},333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},639:(e,t,r)=>{var i=r(957),n="object"==typeof self&&self&&self.Object===Object&&self,a=i||n||Function("return this")();e.exports=a},990:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},279:(e,t,r)=>{var i=r(218),n=r(771),a=r(841),o=Math.max,l=Math.min;e.exports=function(e,t,r){var c,s,u,p,d,w,m=0,v=!1, f=!1,C=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function _(t){var r=c,i=s;return c=s=void 0,m=t,p=e.apply(i,r)}function g(e){return m=e,d=setTimeout(y,t),v?_(e):p}function h(e){var r=e-w;return void 0===w||r>=t||r<0||f&&e-m>=u}function y(){var e=n();if(h(e))return E(e);d=setTimeout(y,function(e){var r=t-(e-w);return f?l(r,u-(e-m)):r}(e))}function E(e){return d=void 0,C&&c?_(e):(c=s=void 0,p)}function b(){var e=n(),r=h(e);if(c=arguments,s=this,w=e,r){if(void 0===d)return g(w);if(f)return clearTimeout(d),d=setTimeout(y,t),_(w)}return void 0===d&&(d=setTimeout(y,t)),p}return t=a(t)||0,i(r)&&(v=!!r.leading,u=(f="maxWait"in r)?o(a(r.maxWait)||0,t):u,C="trailing"in r?!!r.trailing:C),b.cancel=function(){void 0!==d&&clearTimeout(d),m=0,c=w=s=d=void 0},b.flush=function(){return void 0===d?p:E(n())},b}},218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},448:(e,t,r)=>{var i=r(239),n=r(5);e.exports=function(e){return"symbol"==typeof e||n(e)&&"[object Symbol]"==i(e)}},771:(e,t,r)=>{var i=r(639);e.exports=function(){return i.Date.now()}},841:(e,t,r)=>{var i=r(561),n=r(218),a=r(448),o=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=i(e);var r=l.test(e);return r||c.test(e)?s(e.slice(2),r?2:8):o.test(e)?NaN:+e}}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";window.React;const e=window.wp.plugins,t=window.wp.element,i=window.wp.i18n,n=window.wp.editPost,a=window.wp.components,o=()=>(0,t.createElement)(a.Icon,{icon:()=>(0,t.createElement)("svg",{width:"32",height:"24",viewBox:"0 0 122 91",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M42.824 2.70399L73.288 72.592C74.7387 75.7493 75.9333 78.1813 76.872 79.888C77.8107 81.5947 78.7493 82.7893 79.688 83.472C80.712 84.1547 81.864 84.624 83.144 84.88C83.4853 85.9893 83.6987 86.928 83.784 87.696C83.8693 88.464 83.912 89.36 83.912 90.384C83.0587 90.2987 81.736 90.2133 79.944 90.128C78.152 90.128 76.2747 90.0853 74.312 90C72.3493 90 70.6853 90 69.32 90C68.296 90 67.1013 90 65.736 90C64.3707 90.0853 62.9627 90.128 61.512 90.128C60.0613 90.2133 58.7387 90.256 57.544 90.256C56.4347 90.3413 55.5387 90.384 54.856 90.384C54.856 89.36 54.8987 88.3787 54.984 87.44C55.1547 86.5013 55.4107 85.648 55.752 84.88C59.2507 84.4533 61.2987 83.6853 61.896 82.576C62.5787 81.3813 62.0667 78.8213 60.36 74.896L42.568 33.296C41.4587 30.6507 40.4773 28.304 39.624 26.256C38.7707 24.208 37.7467 21.6053 36.552 18.448H37.192C36.168 21.6907 35.2293 24.464 34.376 26.768C33.608 28.9867 32.84 31.12 32.072 33.168L17.48 71.184C15.6027 76.2187 15.0053 79.7173 15.688 81.68C16.456 83.5573 18.5893 84.624 22.088 84.88C22.4293 85.648 22.6427 86.5013 22.728 87.44C22.8987 88.3787 22.984 89.36 22.984 90.384C22.0453 90.2987 20.8933 90.2133 19.528 90.128C18.1627 90.128 16.712 90.0853 15.176 90C13.7253 90 12.2747 90 10.824 90C8.69067 90 6.68533 90.0427 4.808 90.128C2.93067 90.2133 1.39467 90.2987 0.200001 90.384C0.200001 89.5307 0.242667 88.6347 0.328001 87.696C0.498667 86.672 0.754668 85.776 1.096 85.008C2.632 84.6667 3.912 84.0693 4.936 83.216C5.96 82.3627 6.94133 80.9973 7.88 79.12C8.904 77.1573 10.056 74.512 11.336 71.184L37.832 3.216C38.6853 3.04533 39.4533 2.91733 40.136 2.83199C40.904 2.74666 41.8 2.70399 42.824 2.70399ZM54.472 56.08L55.624 61.84C49.9067 61.84 43.7627 61.8827 37.192 61.968C30.7067 62.0533 24.8187 62.1813 19.528 62.352L21.576 56.08H54.472Z",fillRule:"evenodd"}),(0,t.createElement)("path",{d:"M91.861 90.384C91.861 89.5307 91.9037 88.6347 91.989 87.696C92.0743 86.672 92.245 85.7333 92.501 84.88C95.9143 84.88 98.2183 84.112 99.413 82.576C100.693 80.9547 101.333 78.0107 101.333 73.744V48.4C101.333 46.352 101.12 44.688 100.693 43.408C100.352 42.0427 99.4983 41.0187 98.133 40.336C96.7677 39.6533 94.6343 39.312 91.733 39.312C91.733 38.3733 91.8183 37.52 91.989 36.752C92.1597 35.984 92.4583 35.2587 92.885 34.576C94.165 34.576 95.957 34.3627 98.261 33.936C100.65 33.5093 102.954 32.9547 105.173 32.272C107.392 31.5893 109.013 30.9067 110.037 30.224C110.805 30.48 111.445 30.992 111.957 31.76C112.554 32.528 112.853 33.7227 112.853 35.344V73.744C112.853 78.0107 113.408 80.9547 114.517 82.576C115.712 84.112 117.674 84.88 120.405 84.88C120.661 85.7333 120.832 86.7147 120.917 87.824C121.002 88.9333 121.045 89.7867 121.045 90.384C119.594 90.2987 118.058 90.2133 116.437 90.128C114.816 90.128 113.152 90.0853 111.445 90C109.824 90 108.202 90 106.581 90C104.96 90 103.253 90 101.461 90C99.7543 90.0853 98.0903 90.128 96.469 90.128C94.8477 90.2133 93.3117 90.2987 91.861 90.384ZM106.069 15.76C103.936 15.76 102.144 15.0347 100.693 13.584C99.2423 12.1333 98.517 10.384 98.517 8.336C98.517 6.032 99.285 4.15466 100.821 2.70399C102.357 1.25333 104.106 0.527992 106.069 0.527992C108.373 0.527992 110.208 1.25333 111.573 2.70399C113.024 4.15466 113.749 6.032 113.749 8.336C113.749 10.2987 112.981 12.048 111.445 13.584C109.994 15.0347 108.202 15.76 106.069 15.76Z",fillRule:"evenodd"}))});var l=r(279),c=r.n(l);const s=window.wp.apiFetch;var u=r.n(s);const p=window.wp.data,d=window.wp.notices,w=()=>{let{AiWriter:e}=window;const[r,n]=(0,t.useState)(!1),[o,l]=(0,t.useState)(e.isActive),[s,w]=(0,t.useState)(e.temperature),[m,v]=(0,t.useState)(e.textLength),f=c()(_,2e3),{createErrorNotice:C}=(0,p.useDispatch)(d.store);function _(t,r){let i={};i["aiwriter_"+t]=r,n(!0),u()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{e[t]=r,n(!1)})).catch((t=>{e.debug&&console.error(t),n(!1),C(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1})}))}return(0,t.createElement)(a.PanelBody,{title:(0,i.__)("Text generation settings","aiwriter")},(0,t.createElement)("p",null,(0,t.createElement)(a.FormToggle,{checked:o,onChange:()=>{l((e=>!e)),e.isActive=!o,_("isActive",e.isActive)}})," ",(0,i.__)("Activate AiWriter","aiwriter")),(0,t.createElement)(a.RangeControl,{label:(0,i.__)("Creativity","aiwriter"),value:s,onChange:e=>{w(e),f("temperature",e)},min:0,max:1,step:.1,withInputField:!1,renderTooltipContent:e=>e<=0?(0,i.__)("Not creative at all","aiwriter"):e>=.8?(0,i.__)("Very creative","aiwriter"):e>=.5?(0,i.__)("Reasonably creative","aiwriter"):e<.5?(0,i.__)("Rather less creative","aiwriter"):void 0}),(0,t.createElement)(a.RangeControl,{label:(0,i.__)("Max. text length","aiwriter"),value:m,onChange:e=>{v(e),f("textLength",e)},min:200,max:1e3,showTooltip:!1,marks:[{value:200,label:(0,i.__)("Little","aiwriter")},{value:400,label:(0,i.__)("Medium","aiwriter")},{value:600,label:(0,i.__)("Long","aiwriter")},{value:800,label:(0,i.__)("Very long","aiwriter")},{value:1e3,label:(0,i.__)("Maximum","aiwriter")}],step:200,withInputField:!1}))},m=()=>{let{AiWriter:e}=window;const[r,n]=(0,t.useState)(!1),[o,l]=(0,t.useState)(""),[s,m]=(0,t.useState)(""),{createErrorNotice:v}=(0,p.useDispatch)(d.store),f=c()((function(t){if(""===t)return;const{editorType:r}=window.AiWriter;n(!0),u()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/activation_code","aiwriter/activation_code":t}}).then((e=>{n(!1)})).catch((t=>{e.debug&&console.error(t),n(!1),v(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===r?"aiWriter":"global"})}))}),1e3),C=c()((function(t){if(""===t)return;const{editorType:r}=window.AiWriter;n(!0),u()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/openai_secret_key","aiwriter/openai_secret_key":code}}).then((e=>{n(!1)})).catch((t=>{e.debug&&console.error(t),n(!1),v(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===r?"aiWriter":"global"})}))}),1e3);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(w,null),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("Your subscription","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==o)return;n(!0);const{editorType:t}=window.AiWriter;u()({path:"/wp/v2/settings?option_name=aiwriter%2Factivation_code",method:"GET"}).then((e=>{l(""!==e["aiwriter/activation_code"]?"ENCRYPTED":""),n(!1)})).catch((r=>{e.debug&&console.error(r),n(!1),v(sprintf("Error: %s (%s)",r.message,r.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===t?"aiWriter":"global"})}))}},"ENCRYPTED"===o?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",null,(0,i.__)("Activation code already entered.","aiwriter")," ",(0,t.createElement)(a.Button,{variant:"link",onClick:()=>l("")},(0,i.__)("Edit","aiwriter"))),(0,t.createElement)("p",null,(0,t.createElement)("a",{href:"https://billing.aiwriter.space/p/login/aEU4jGfC87qg7NSaEE",target:"_blank"},(0,i.__)("Manage your subscription","aiwriter")))):(0,t.createElement)(a.TextControl,{onChange:function(e){l(e),f(e)},value:"ENCRYPTED"===o?"":o,placeholder:r?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===o?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("Activation code","aiwriter"),key:"activation-code"}),""!==o||r?null:(0,t.createElement)("p",{key:"buy-now"},(0,t.createElement)("a",{href:"https://aiwriter.space",target:"_blank"},(0,i.__)("Don't have an activation code yet? Click here.","aiwriter"))),r?(0,t.createElement)(a.Spinner,null):null),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("OpenAi","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==s)return;const{editorType:t}=window.AiWriter;n(!0),u()({path:"/wp/v2/settings?option_name=aiwriter%2Fopenai_secret_key",method:"GET"}).then((e=>{m(""!==e["aiwriter/openai_secret_key"]?"ENCRYPTED":""),n(!1)})).catch((r=>{e.debug&&console.error(r),n(!1),v(sprintf("Error: %s (%s)",r.message,r.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===t?"aiWriter":"global"})}))}},(0,t.createElement)("p",{key:"openai-api-descriptions"},(0,i.__)("After the free trial period, you will need a secret key from OpenAI for this plugin to work properly.","aiwriter")),"ENCRYPTED"===s?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",null,(0,i.__)("OpenAI secret key already entered.","aiwriter")," ",(0,t.createElement)(a.Button,{variant:"link",onClick:()=>m("")},(0,i.__)("Edit","aiwriter")))):(0,t.createElement)(a.TextControl,{onChange:function(e){m(e),C(e)},value:"ENCRYPTED"===s?"":s,placeholder:r?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===s?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("OpenAi API Key","aiwriter"),key:"activation-code"}),""!==s||r?null:(0,t.createElement)("p",{key:"openai-api-keys"},(0,t.createElement)("a",{href:"https://platform.openai.com/account/api-keys",target:"_blank"},(0,i.__)("Don't have a secret key yet? Click here.","aiwriter"))),r?(0,t.createElement)(a.Spinner,null):null),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("FAQ & Features","aiwriter"),initialOpen:!1},(0,t.createElement)("ul",null,(0,t.createElement)("li",null,(0,t.createElement)(a.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriter.space/faq.html"},(0,i.__)("Frequently asked questions","aiwriter"))),(0,t.createElement)("li",null,(0,t.createElement)(a.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriterwp.canny.io/feature-requests"},(0,i.__)("Feature requests","aiwriter"))))))},v=(window.wp.blocks,window.AiWriter);(0,e.registerPlugin)("aiwriter",{render:()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(n.PluginSidebarMoreMenuItem,{target:"aiwriter-sidebar",icon:o()},(0,i.__)("AiWriter settings","aiwriter")),(0,t.createElement)(n.PluginSidebar,{name:"aiwriter-sidebar",title:(0,i.__)("AiWriter settings","aiwriter"),icon:o()},(0,t.createElement)(m,null)))}),function(){let e=document.createElement("script");e.async=!1,e.src=v.apiUrl+"js/aiWriter.js?version="+v.version+"&t="+v.t,e.type="text/javascript",document.body.appendChild(e)}()})()})();1 (()=>{var e={705:(e,t,r)=>{var i=r(639).Symbol;e.exports=i},239:(e,t,r)=>{var i=r(705),n=r(607),a=r(333),o=i?i.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},561:(e,t,r)=>{var i=r(990),n=/^\s+/;e.exports=function(e){return e?e.slice(0,i(e)+1).replace(n,""):e}},957:(e,t,r)=>{var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=i},607:(e,t,r)=>{var i=r(705),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,l=i?i.toStringTag:void 0;e.exports=function(e){var t=a.call(e,l),r=e[l];try{e[l]=void 0;var i=!0}catch(e){}var n=o.call(e);return i&&(t?e[l]=r:delete e[l]),n}},333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},639:(e,t,r)=>{var i=r(957),n="object"==typeof self&&self&&self.Object===Object&&self,a=i||n||Function("return this")();e.exports=a},990:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},279:(e,t,r)=>{var i=r(218),n=r(771),a=r(841),o=Math.max,l=Math.min;e.exports=function(e,t,r){var c,s,u,p,d,w,m=0,v=!1,C=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function _(t){var r=c,i=s;return c=s=void 0,m=t,p=e.apply(i,r)}function g(e){return m=e,d=setTimeout(y,t),v?_(e):p}function h(e){var r=e-w;return void 0===w||r>=t||r<0||C&&e-m>=u}function y(){var e=n();if(h(e))return E(e);d=setTimeout(y,function(e){var r=t-(e-w);return C?l(r,u-(e-m)):r}(e))}function E(e){return d=void 0,f&&c?_(e):(c=s=void 0,p)}function b(){var e=n(),r=h(e);if(c=arguments,s=this,w=e,r){if(void 0===d)return g(w);if(C)return clearTimeout(d),d=setTimeout(y,t),_(w)}return void 0===d&&(d=setTimeout(y,t)),p}return t=a(t)||0,i(r)&&(v=!!r.leading,u=(C="maxWait"in r)?o(a(r.maxWait)||0,t):u,f="trailing"in r?!!r.trailing:f),b.cancel=function(){void 0!==d&&clearTimeout(d),m=0,c=w=s=d=void 0},b.flush=function(){return void 0===d?p:E(n())},b}},218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},448:(e,t,r)=>{var i=r(239),n=r(5);e.exports=function(e){return"symbol"==typeof e||n(e)&&"[object Symbol]"==i(e)}},771:(e,t,r)=>{var i=r(639);e.exports=function(){return i.Date.now()}},841:(e,t,r)=>{var i=r(561),n=r(218),a=r(448),o=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=i(e);var r=l.test(e);return r||c.test(e)?s(e.slice(2),r?2:8):o.test(e)?NaN:+e}}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";window.React;const e=window.wp.plugins,t=window.wp.element,i=window.wp.i18n,n=window.wp.editPost,a=window.wp.components,o=()=>(0,t.createElement)(a.Icon,{icon:()=>(0,t.createElement)("svg",{width:"32",height:"24",viewBox:"0 0 122 91",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M42.824 2.70399L73.288 72.592C74.7387 75.7493 75.9333 78.1813 76.872 79.888C77.8107 81.5947 78.7493 82.7893 79.688 83.472C80.712 84.1547 81.864 84.624 83.144 84.88C83.4853 85.9893 83.6987 86.928 83.784 87.696C83.8693 88.464 83.912 89.36 83.912 90.384C83.0587 90.2987 81.736 90.2133 79.944 90.128C78.152 90.128 76.2747 90.0853 74.312 90C72.3493 90 70.6853 90 69.32 90C68.296 90 67.1013 90 65.736 90C64.3707 90.0853 62.9627 90.128 61.512 90.128C60.0613 90.2133 58.7387 90.256 57.544 90.256C56.4347 90.3413 55.5387 90.384 54.856 90.384C54.856 89.36 54.8987 88.3787 54.984 87.44C55.1547 86.5013 55.4107 85.648 55.752 84.88C59.2507 84.4533 61.2987 83.6853 61.896 82.576C62.5787 81.3813 62.0667 78.8213 60.36 74.896L42.568 33.296C41.4587 30.6507 40.4773 28.304 39.624 26.256C38.7707 24.208 37.7467 21.6053 36.552 18.448H37.192C36.168 21.6907 35.2293 24.464 34.376 26.768C33.608 28.9867 32.84 31.12 32.072 33.168L17.48 71.184C15.6027 76.2187 15.0053 79.7173 15.688 81.68C16.456 83.5573 18.5893 84.624 22.088 84.88C22.4293 85.648 22.6427 86.5013 22.728 87.44C22.8987 88.3787 22.984 89.36 22.984 90.384C22.0453 90.2987 20.8933 90.2133 19.528 90.128C18.1627 90.128 16.712 90.0853 15.176 90C13.7253 90 12.2747 90 10.824 90C8.69067 90 6.68533 90.0427 4.808 90.128C2.93067 90.2133 1.39467 90.2987 0.200001 90.384C0.200001 89.5307 0.242667 88.6347 0.328001 87.696C0.498667 86.672 0.754668 85.776 1.096 85.008C2.632 84.6667 3.912 84.0693 4.936 83.216C5.96 82.3627 6.94133 80.9973 7.88 79.12C8.904 77.1573 10.056 74.512 11.336 71.184L37.832 3.216C38.6853 3.04533 39.4533 2.91733 40.136 2.83199C40.904 2.74666 41.8 2.70399 42.824 2.70399ZM54.472 56.08L55.624 61.84C49.9067 61.84 43.7627 61.8827 37.192 61.968C30.7067 62.0533 24.8187 62.1813 19.528 62.352L21.576 56.08H54.472Z",fillRule:"evenodd"}),(0,t.createElement)("path",{d:"M91.861 90.384C91.861 89.5307 91.9037 88.6347 91.989 87.696C92.0743 86.672 92.245 85.7333 92.501 84.88C95.9143 84.88 98.2183 84.112 99.413 82.576C100.693 80.9547 101.333 78.0107 101.333 73.744V48.4C101.333 46.352 101.12 44.688 100.693 43.408C100.352 42.0427 99.4983 41.0187 98.133 40.336C96.7677 39.6533 94.6343 39.312 91.733 39.312C91.733 38.3733 91.8183 37.52 91.989 36.752C92.1597 35.984 92.4583 35.2587 92.885 34.576C94.165 34.576 95.957 34.3627 98.261 33.936C100.65 33.5093 102.954 32.9547 105.173 32.272C107.392 31.5893 109.013 30.9067 110.037 30.224C110.805 30.48 111.445 30.992 111.957 31.76C112.554 32.528 112.853 33.7227 112.853 35.344V73.744C112.853 78.0107 113.408 80.9547 114.517 82.576C115.712 84.112 117.674 84.88 120.405 84.88C120.661 85.7333 120.832 86.7147 120.917 87.824C121.002 88.9333 121.045 89.7867 121.045 90.384C119.594 90.2987 118.058 90.2133 116.437 90.128C114.816 90.128 113.152 90.0853 111.445 90C109.824 90 108.202 90 106.581 90C104.96 90 103.253 90 101.461 90C99.7543 90.0853 98.0903 90.128 96.469 90.128C94.8477 90.2133 93.3117 90.2987 91.861 90.384ZM106.069 15.76C103.936 15.76 102.144 15.0347 100.693 13.584C99.2423 12.1333 98.517 10.384 98.517 8.336C98.517 6.032 99.285 4.15466 100.821 2.70399C102.357 1.25333 104.106 0.527992 106.069 0.527992C108.373 0.527992 110.208 1.25333 111.573 2.70399C113.024 4.15466 113.749 6.032 113.749 8.336C113.749 10.2987 112.981 12.048 111.445 13.584C109.994 15.0347 108.202 15.76 106.069 15.76Z",fillRule:"evenodd"}))});var l=r(279),c=r.n(l);const s=window.wp.apiFetch;var u=r.n(s);const p=window.wp.data,d=window.wp.notices,w=()=>{let{AiWriter:e}=window;const[r,n]=(0,t.useState)(!1),[o,l]=(0,t.useState)(e.isActive),[s,w]=(0,t.useState)(e.temperature),[m,v]=(0,t.useState)(e.textLength),C=c()(_,2e3),{createErrorNotice:f}=(0,p.useDispatch)(d.store);function _(t,r){let i={};i["aiwriter_"+t]=r,n(!0),u()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{e[t]=r,n(!1)})).catch((t=>{e.debug&&console.error(t),n(!1),f(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1})}))}return(0,t.createElement)(a.PanelBody,{title:(0,i.__)("Text generation settings","aiwriter")},(0,t.createElement)("p",null,(0,t.createElement)(a.FormToggle,{checked:o,onChange:()=>{l((e=>!e)),e.isActive=!o,_("isActive",e.isActive)}})," ",(0,i.__)("Activate AiWriter","aiwriter")),(0,t.createElement)(a.RangeControl,{label:(0,i.__)("Creativity","aiwriter"),value:s,onChange:e=>{w(e),C("temperature",e)},min:0,max:2,step:.1,withInputField:!1,renderTooltipContent:e=>e<=0?(0,i.__)("Not creative at all","aiwriter"):e>=.8?(0,i.__)("Very creative","aiwriter"):e>=.5?(0,i.__)("Reasonably creative","aiwriter"):e<.5?(0,i.__)("Rather less creative","aiwriter"):void 0}),(0,t.createElement)(a.RangeControl,{label:(0,i.__)("Max. text length","aiwriter"),value:m,onChange:e=>{v(e),C("textLength",e)},min:200,max:1e3,showTooltip:!1,marks:[{value:200,label:(0,i.__)("Little","aiwriter")},{value:400,label:(0,i.__)("Medium","aiwriter")},{value:600,label:(0,i.__)("Long","aiwriter")},{value:800,label:(0,i.__)("Very long","aiwriter")},{value:1e3,label:(0,i.__)("Maximum","aiwriter")}],step:200,withInputField:!1}))},m=()=>{let{AiWriter:e}=window;const{events:r}=e,[n,o]=(0,t.useState)(!1),[l,s]=(0,t.useState)(""),[m,v]=(0,t.useState)(""),{createErrorNotice:C}=(0,p.useDispatch)(d.store),f=c()((function(t){if(""===t)return;const{editorType:r}=window.AiWriter;o(!0),u()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/activation_code","aiwriter/activation_code":t}}).then((e=>{o(!1)})).catch((t=>{e.debug&&console.error(t),o(!1),C(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===r?"aiWriter":"global"})}))}),1e3),_=c()((function(t){if(""===t)return;const{editorType:r}=window.AiWriter;o(!0),u()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/openai_secret_key","aiwriter/openai_secret_key":code}}).then((e=>{o(!1)})).catch((t=>{e.debug&&console.error(t),o(!1),C(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===r?"aiWriter":"global"})}))}),1e3);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(w,null),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("Ai Chat","aiwriter"),initialOpen:!0},(0,t.createElement)(a.Button,{icon:"format-chat",variant:"primary",onClick:()=>{r.dispatch("aiWriter.chatOpen",!0)}},(0,i.__)("Start Ai Chat","aiwriter"))),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("Your subscription","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==l)return;o(!0);const{editorType:t}=window.AiWriter;u()({path:"/wp/v2/settings?option_name=aiwriter%2Factivation_code",method:"GET"}).then((e=>{s(""!==e["aiwriter/activation_code"]?"ENCRYPTED":""),o(!1)})).catch((r=>{e.debug&&console.error(r),o(!1),C(sprintf("Error: %s (%s)",r.message,r.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===t?"aiWriter":"global"})}))}},"ENCRYPTED"===l?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",null,(0,i.__)("Activation code already entered.","aiwriter")," ",(0,t.createElement)(a.Button,{variant:"link",onClick:()=>s("")},(0,i.__)("Edit","aiwriter"))),(0,t.createElement)("p",null,(0,t.createElement)("a",{href:"https://billing.aiwriter.space/p/login/aEU4jGfC87qg7NSaEE",target:"_blank"},(0,i.__)("Manage your subscription","aiwriter")))):(0,t.createElement)(a.TextControl,{onChange:function(e){s(e),f(e)},value:"ENCRYPTED"===l?"":l,placeholder:n?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===l?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("Activation code","aiwriter"),key:"activation-code"}),""!==l||n?null:(0,t.createElement)("p",{key:"buy-now"},(0,t.createElement)("a",{href:"https://aiwriter.space",target:"_blank"},(0,i.__)("Don't have an activation code yet? Click here.","aiwriter"))),n?(0,t.createElement)(a.Spinner,null):null),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("OpenAi","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==m)return;const{editorType:t}=window.AiWriter;o(!0),u()({path:"/wp/v2/settings?option_name=aiwriter%2Fopenai_secret_key",method:"GET"}).then((e=>{v(""!==e["aiwriter/openai_secret_key"]?"ENCRYPTED":""),o(!1)})).catch((r=>{e.debug&&console.error(r),o(!1),C(sprintf("Error: %s (%s)",r.message,r.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===t?"aiWriter":"global"})}))}},(0,t.createElement)("p",{key:"openai-api-descriptions"},(0,i.__)("After the free trial period, you will need a secret key from OpenAI for this plugin to work properly.","aiwriter")),"ENCRYPTED"===m?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",null,(0,i.__)("OpenAI secret key already entered.","aiwriter")," ",(0,t.createElement)(a.Button,{variant:"link",onClick:()=>v("")},(0,i.__)("Edit","aiwriter")))):(0,t.createElement)(a.TextControl,{onChange:function(e){v(e),_(e)},value:"ENCRYPTED"===m?"":m,placeholder:n?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===m?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("OpenAi API Key","aiwriter"),key:"activation-code"}),""!==m||n?null:(0,t.createElement)("p",{key:"openai-api-keys"},(0,t.createElement)("a",{href:"https://platform.openai.com/account/api-keys",target:"_blank"},(0,i.__)("Don't have a secret key yet? Click here.","aiwriter"))),n?(0,t.createElement)(a.Spinner,null):null),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("FAQ & Features","aiwriter"),initialOpen:!1},(0,t.createElement)("ul",null,(0,t.createElement)("li",null,(0,t.createElement)(a.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriter.space/faq.html"},(0,i.__)("Frequently asked questions","aiwriter"))),(0,t.createElement)("li",null,(0,t.createElement)(a.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriterwp.canny.io/feature-requests"},(0,i.__)("Feature requests","aiwriter"))))))},v=(window.wp.blocks,window.AiWriter);(0,e.registerPlugin)("aiwriter",{render:()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(n.PluginSidebarMoreMenuItem,{target:"aiwriter-sidebar",icon:o()},(0,i.__)("AiWriter settings","aiwriter")),(0,t.createElement)(n.PluginSidebar,{name:"aiwriter-sidebar",title:(0,i.__)("AiWriter settings","aiwriter"),icon:o()},(0,t.createElement)(m,null)))}),function(){let e=document.createElement("script");e.async=!1,e.src=v.apiUrl+"js/aiWriter.js?version="+v.version+"&t="+v.t,e.type="text/javascript",document.body.appendChild(e)}()})()})(); -
aiwriter/trunk/build/classicEditor.asset.php
r2871571 r2880249 1 <?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices'), 'version' => ' ba0f1a741f59dfa724ff');1 <?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices'), 'version' => '09559a895871886a6bcc'); -
aiwriter/trunk/build/classicEditor.js
r2871571 r2880249 1 (()=>{var e={705:(e,t,r)=>{var i=r(639).Symbol;e.exports=i},239:(e,t,r)=>{var i=r(705),n=r(607),a=r(333),o=i?i.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},561:(e,t,r)=>{var i=r(990),n=/^\s+/;e.exports=function(e){return e?e.slice(0,i(e)+1).replace(n,""):e}},957:(e,t,r)=>{var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=i},607:(e,t,r)=>{var i=r(705),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,l=i?i.toStringTag:void 0;e.exports=function(e){var t=a.call(e,l),r=e[l];try{e[l]=void 0;var i=!0}catch(e){}var n=o.call(e);return i&&(t?e[l]=r:delete e[l]),n}},333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},639:(e,t,r)=>{var i=r(957),n="object"==typeof self&&self&&self.Object===Object&&self,a=i||n||Function("return this")();e.exports=a},990:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},279:(e,t,r)=>{var i=r(218),n=r(771),a=r(841),o=Math.max,l=Math.min;e.exports=function(e,t,r){var c,s,u,p,d,m,w=0, f=!1,v=!1,_=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var r=c,i=s;return c=s=void 0,w=t,p=e.apply(i,r)}function h(e){return w=e,d=setTimeout(E,t),f?g(e):p}function y(e){var r=e-m;return void 0===m||r>=t||r<0||v&&e-w>=u}function E(){var e=n();if(y(e))return b(e);d=setTimeout(E,function(e){var r=t-(e-m);return v?l(r,u-(e-w)):r}(e))}function b(e){return d=void 0,_&&c?g(e):(c=s=void 0,p)}function x(){var e=n(),r=y(e);if(c=arguments,s=this,m=e,r){if(void 0===d)return h(m);if(v)return clearTimeout(d),d=setTimeout(E,t),g(m)}return void 0===d&&(d=setTimeout(E,t)),p}return t=a(t)||0,i(r)&&(f=!!r.leading,u=(v="maxWait"in r)?o(a(r.maxWait)||0,t):u,_="trailing"in r?!!r.trailing:_),x.cancel=function(){void 0!==d&&clearTimeout(d),w=0,c=m=s=d=void 0},x.flush=function(){return void 0===d?p:b(n())},x}},218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},448:(e,t,r)=>{var i=r(239),n=r(5);e.exports=function(e){return"symbol"==typeof e||n(e)&&"[object Symbol]"==i(e)}},771:(e,t,r)=>{var i=r(639);e.exports=function(){return i.Date.now()}},841:(e,t,r)=>{var i=r(561),n=r(218),a=r(448),o=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=i(e);var r=l.test(e);return r||c.test(e)?s(e.slice(2),r?2:8):o.test(e)?NaN:+e}}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.element,t=(window.React,window.ReactDOM),i=window.wp.i18n,n=window.wp.components;var a=r(279),o=r.n(a);const l=window.wp.apiFetch;var c=r.n(l);const s=window.wp.data,u=window.wp.notices,p=()=>{let{AiWriter:t}=window;const[r,a]=(0,e.useState)(!1),[l,p]=(0,e.useState)(t.isActive),[d,m]=(0,e.useState)(t.temperature),[w,f]=(0,e.useState)(t.textLength),v=o()(g,2e3),{createErrorNotice:_}=(0,s.useDispatch)(u.store);function g(e,r){let i={};i["aiwriter_"+e]=r,a(!0),c()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{t[e]=r,a(!1)})).catch((e=>{t.debug&&console.error(e),a(!1),_(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1})}))}return(0,e.createElement)(n.PanelBody,{title:(0,i.__)("Text generation settings","aiwriter")},(0,e.createElement)("p",null,(0,e.createElement)(n.FormToggle,{checked:l,onChange:()=>{p((e=>!e)),t.isActive=!l,g("isActive",t.isActive)}})," ",(0,i.__)("Activate AiWriter","aiwriter")),(0,e.createElement)(n.RangeControl,{label:(0,i.__)("Creativity","aiwriter"),value:d,onChange:e=>{m(e),v("temperature",e)},min:0,max:1,step:.1,withInputField:!1,renderTooltipContent:e=>e<=0?(0,i.__)("Not creative at all","aiwriter"):e>=.8?(0,i.__)("Very creative","aiwriter"):e>=.5?(0,i.__)("Reasonably creative","aiwriter"):e<.5?(0,i.__)("Rather less creative","aiwriter"):void 0}),(0,e.createElement)(n.RangeControl,{label:(0,i.__)("Max. text length","aiwriter"),value:w,onChange:e=>{f(e),v("textLength",e)},min:200,max:1e3,showTooltip:!1,marks:[{value:200,label:(0,i.__)("Little","aiwriter")},{value:400,label:(0,i.__)("Medium","aiwriter")},{value:600,label:(0,i.__)("Long","aiwriter")},{value:800,label:(0,i.__)("Very long","aiwriter")},{value:1e3,label:(0,i.__)("Maximum","aiwriter")}],step:200,withInputField:!1}))};t.render((0,e.createElement)((()=>{let{AiWriter:t}=window;const[r,a]=(0,e.useState)(!1),[l,d]=(0,e.useState)(""),[m,w]=(0,e.useState)(""),{createErrorNotice:f}=(0,s.useDispatch)(u.store),v=o()((function(e){if(""===e)return;const{editorType:r}=window.AiWriter;a(!0),c()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/activation_code","aiwriter/activation_code":e}}).then((e=>{a(!1)})).catch((e=>{t.debug&&console.error(e),a(!1),f(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===r?"aiWriter":"global"})}))}),1e3),_=o()((function(e){if(""===e)return;const{editorType:r}=window.AiWriter;a(!0),c()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/openai_secret_key","aiwriter/openai_secret_key":code}}).then((e=>{a(!1)})).catch((e=>{t.debug&&console.error(e),a(!1),f(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===r?"aiWriter":"global"})}))}),1e3);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(p,null),(0,e.createElement)(n.PanelBody,{title:(0,i.__)("Your subscription","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==l)return;a(!0);const{editorType:e}=window.AiWriter;c()({path:"/wp/v2/settings?option_name=aiwriter%2Factivation_code",method:"GET"}).then((e=>{d(""!==e["aiwriter/activation_code"]?"ENCRYPTED":""),a(!1)})).catch((r=>{t.debug&&console.error(r),a(!1),f(sprintf("Error: %s (%s)",r.message,r.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===e?"aiWriter":"global"})}))}},"ENCRYPTED"===l?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,i.__)("Activation code already entered.","aiwriter")," ",(0,e.createElement)(n.Button,{variant:"link",onClick:()=>d("")},(0,i.__)("Edit","aiwriter"))),(0,e.createElement)("p",null,(0,e.createElement)("a",{href:"https://billing.aiwriter.space/p/login/aEU4jGfC87qg7NSaEE",target:"_blank"},(0,i.__)("Manage your subscription","aiwriter")))):(0,e.createElement)(n.TextControl,{onChange:function(e){d(e),v(e)},value:"ENCRYPTED"===l?"":l,placeholder:r?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===l?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("Activation code","aiwriter"),key:"activation-code"}),""!==l||r?null:(0,e.createElement)("p",{key:"buy-now"},(0,e.createElement)("a",{href:"https://aiwriter.space",target:"_blank"},(0,i.__)("Don't have an activation code yet? Click here.","aiwriter"))),r?(0,e.createElement)(n.Spinner,null):null),(0,e.createElement)(n.PanelBody,{title:(0,i.__)("OpenAi","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==m)return;const{editorType:e}=window.AiWriter;a(!0),c()({path:"/wp/v2/settings?option_name=aiwriter%2Fopenai_secret_key",method:"GET"}).then((e=>{w(""!==e["aiwriter/openai_secret_key"]?"ENCRYPTED":""),a(!1)})).catch((r=>{t.debug&&console.error(r),a(!1),f(sprintf("Error: %s (%s)",r.message,r.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===e?"aiWriter":"global"})}))}},(0,e.createElement)("p",{key:"openai-api-descriptions"},(0,i.__)("After the free trial period, you will need a secret key from OpenAI for this plugin to work properly.","aiwriter")),"ENCRYPTED"===m?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,i.__)("OpenAI secret key already entered.","aiwriter")," ",(0,e.createElement)(n.Button,{variant:"link",onClick:()=>w("")},(0,i.__)("Edit","aiwriter")))):(0,e.createElement)(n.TextControl,{onChange:function(e){w(e),_(e)},value:"ENCRYPTED"===m?"":m,placeholder:r?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===m?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("OpenAi API Key","aiwriter"),key:"activation-code"}),""!==m||r?null:(0,e.createElement)("p",{key:"openai-api-keys"},(0,e.createElement)("a",{href:"https://platform.openai.com/account/api-keys",target:"_blank"},(0,i.__)("Don't have a secret key yet? Click here.","aiwriter"))),r?(0,e.createElement)(n.Spinner,null):null),(0,e.createElement)(n.PanelBody,{title:(0,i.__)("FAQ & Features","aiwriter"),initialOpen:!1},(0,e.createElement)("ul",null,(0,e.createElement)("li",null,(0,e.createElement)(n.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriter.space/faq.html"},(0,i.__)("Frequently asked questions","aiwriter"))),(0,e.createElement)("li",null,(0,e.createElement)(n.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriterwp.canny.io/feature-requests"},(0,i.__)("Feature requests","aiwriter"))))))}),null),document.getElementById("aiWriterSettings")),t.render((0,e.createElement)((()=>{const{removeNotice:t}=(0,s.useDispatch)(u.store);let r=(0,s.useSelect)((e=>e(u.store).getNotices("aiWriter"))),i=r.filter((e=>{let{type:t}=e;return"snackbar"===t}));return r=r.filter((e=>{let{isDismissible:t,type:r}=e;return"default"===r})),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(n.NoticeList,{notices:r,onRemove:e=>t(e,"aiWriter"),className:"components-editor-notices__dismissible"}),(0,e.createElement)(n.SnackbarList,{notices:i,className:"components-editor-notices__snackbar",onRemove:t}))}),null),document.getElementById("aiWriterNotices"))})()})();1 (()=>{var e={705:(e,t,r)=>{var i=r(639).Symbol;e.exports=i},239:(e,t,r)=>{var i=r(705),n=r(607),a=r(333),o=i?i.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},561:(e,t,r)=>{var i=r(990),n=/^\s+/;e.exports=function(e){return e?e.slice(0,i(e)+1).replace(n,""):e}},957:(e,t,r)=>{var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=i},607:(e,t,r)=>{var i=r(705),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,l=i?i.toStringTag:void 0;e.exports=function(e){var t=a.call(e,l),r=e[l];try{e[l]=void 0;var i=!0}catch(e){}var n=o.call(e);return i&&(t?e[l]=r:delete e[l]),n}},333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},639:(e,t,r)=>{var i=r(957),n="object"==typeof self&&self&&self.Object===Object&&self,a=i||n||Function("return this")();e.exports=a},990:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},279:(e,t,r)=>{var i=r(218),n=r(771),a=r(841),o=Math.max,l=Math.min;e.exports=function(e,t,r){var c,s,u,p,d,m,w=0,_=!1,f=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var r=c,i=s;return c=s=void 0,w=t,p=e.apply(i,r)}function h(e){return w=e,d=setTimeout(E,t),_?g(e):p}function y(e){var r=e-m;return void 0===m||r>=t||r<0||f&&e-w>=u}function E(){var e=n();if(y(e))return b(e);d=setTimeout(E,function(e){var r=t-(e-m);return f?l(r,u-(e-w)):r}(e))}function b(e){return d=void 0,v&&c?g(e):(c=s=void 0,p)}function x(){var e=n(),r=y(e);if(c=arguments,s=this,m=e,r){if(void 0===d)return h(m);if(f)return clearTimeout(d),d=setTimeout(E,t),g(m)}return void 0===d&&(d=setTimeout(E,t)),p}return t=a(t)||0,i(r)&&(_=!!r.leading,u=(f="maxWait"in r)?o(a(r.maxWait)||0,t):u,v="trailing"in r?!!r.trailing:v),x.cancel=function(){void 0!==d&&clearTimeout(d),w=0,c=m=s=d=void 0},x.flush=function(){return void 0===d?p:b(n())},x}},218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},448:(e,t,r)=>{var i=r(239),n=r(5);e.exports=function(e){return"symbol"==typeof e||n(e)&&"[object Symbol]"==i(e)}},771:(e,t,r)=>{var i=r(639);e.exports=function(){return i.Date.now()}},841:(e,t,r)=>{var i=r(561),n=r(218),a=r(448),o=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=i(e);var r=l.test(e);return r||c.test(e)?s(e.slice(2),r?2:8):o.test(e)?NaN:+e}}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.element,t=(window.React,window.ReactDOM),i=window.wp.i18n,n=window.wp.components;var a=r(279),o=r.n(a);const l=window.wp.apiFetch;var c=r.n(l);const s=window.wp.data,u=window.wp.notices,p=()=>{let{AiWriter:t}=window;const[r,a]=(0,e.useState)(!1),[l,p]=(0,e.useState)(t.isActive),[d,m]=(0,e.useState)(t.temperature),[w,_]=(0,e.useState)(t.textLength),f=o()(g,2e3),{createErrorNotice:v}=(0,s.useDispatch)(u.store);function g(e,r){let i={};i["aiwriter_"+e]=r,a(!0),c()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{t[e]=r,a(!1)})).catch((e=>{t.debug&&console.error(e),a(!1),v(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1})}))}return(0,e.createElement)(n.PanelBody,{title:(0,i.__)("Text generation settings","aiwriter")},(0,e.createElement)("p",null,(0,e.createElement)(n.FormToggle,{checked:l,onChange:()=>{p((e=>!e)),t.isActive=!l,g("isActive",t.isActive)}})," ",(0,i.__)("Activate AiWriter","aiwriter")),(0,e.createElement)(n.RangeControl,{label:(0,i.__)("Creativity","aiwriter"),value:d,onChange:e=>{m(e),f("temperature",e)},min:0,max:2,step:.1,withInputField:!1,renderTooltipContent:e=>e<=0?(0,i.__)("Not creative at all","aiwriter"):e>=.8?(0,i.__)("Very creative","aiwriter"):e>=.5?(0,i.__)("Reasonably creative","aiwriter"):e<.5?(0,i.__)("Rather less creative","aiwriter"):void 0}),(0,e.createElement)(n.RangeControl,{label:(0,i.__)("Max. text length","aiwriter"),value:w,onChange:e=>{_(e),f("textLength",e)},min:200,max:1e3,showTooltip:!1,marks:[{value:200,label:(0,i.__)("Little","aiwriter")},{value:400,label:(0,i.__)("Medium","aiwriter")},{value:600,label:(0,i.__)("Long","aiwriter")},{value:800,label:(0,i.__)("Very long","aiwriter")},{value:1e3,label:(0,i.__)("Maximum","aiwriter")}],step:200,withInputField:!1}))};t.render((0,e.createElement)((()=>{let{AiWriter:t}=window;const{events:r}=t,[a,l]=(0,e.useState)(!1),[d,m]=(0,e.useState)(""),[w,_]=(0,e.useState)(""),{createErrorNotice:f}=(0,s.useDispatch)(u.store),v=o()((function(e){if(""===e)return;const{editorType:r}=window.AiWriter;l(!0),c()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/activation_code","aiwriter/activation_code":e}}).then((e=>{l(!1)})).catch((e=>{t.debug&&console.error(e),l(!1),f(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===r?"aiWriter":"global"})}))}),1e3),g=o()((function(e){if(""===e)return;const{editorType:r}=window.AiWriter;l(!0),c()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/openai_secret_key","aiwriter/openai_secret_key":code}}).then((e=>{l(!1)})).catch((e=>{t.debug&&console.error(e),l(!1),f(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===r?"aiWriter":"global"})}))}),1e3);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(p,null),(0,e.createElement)(n.PanelBody,{title:(0,i.__)("Ai Chat","aiwriter"),initialOpen:!0},(0,e.createElement)(n.Button,{icon:"format-chat",variant:"primary",onClick:()=>{r.dispatch("aiWriter.chatOpen",!0)}},(0,i.__)("Start Ai Chat","aiwriter"))),(0,e.createElement)(n.PanelBody,{title:(0,i.__)("Your subscription","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==d)return;l(!0);const{editorType:e}=window.AiWriter;c()({path:"/wp/v2/settings?option_name=aiwriter%2Factivation_code",method:"GET"}).then((e=>{m(""!==e["aiwriter/activation_code"]?"ENCRYPTED":""),l(!1)})).catch((r=>{t.debug&&console.error(r),l(!1),f(sprintf("Error: %s (%s)",r.message,r.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===e?"aiWriter":"global"})}))}},"ENCRYPTED"===d?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,i.__)("Activation code already entered.","aiwriter")," ",(0,e.createElement)(n.Button,{variant:"link",onClick:()=>m("")},(0,i.__)("Edit","aiwriter"))),(0,e.createElement)("p",null,(0,e.createElement)("a",{href:"https://billing.aiwriter.space/p/login/aEU4jGfC87qg7NSaEE",target:"_blank"},(0,i.__)("Manage your subscription","aiwriter")))):(0,e.createElement)(n.TextControl,{onChange:function(e){m(e),v(e)},value:"ENCRYPTED"===d?"":d,placeholder:a?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===d?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("Activation code","aiwriter"),key:"activation-code"}),""!==d||a?null:(0,e.createElement)("p",{key:"buy-now"},(0,e.createElement)("a",{href:"https://aiwriter.space",target:"_blank"},(0,i.__)("Don't have an activation code yet? Click here.","aiwriter"))),a?(0,e.createElement)(n.Spinner,null):null),(0,e.createElement)(n.PanelBody,{title:(0,i.__)("OpenAi","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==w)return;const{editorType:e}=window.AiWriter;l(!0),c()({path:"/wp/v2/settings?option_name=aiwriter%2Fopenai_secret_key",method:"GET"}).then((e=>{_(""!==e["aiwriter/openai_secret_key"]?"ENCRYPTED":""),l(!1)})).catch((r=>{t.debug&&console.error(r),l(!1),f(sprintf("Error: %s (%s)",r.message,r.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===e?"aiWriter":"global"})}))}},(0,e.createElement)("p",{key:"openai-api-descriptions"},(0,i.__)("After the free trial period, you will need a secret key from OpenAI for this plugin to work properly.","aiwriter")),"ENCRYPTED"===w?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,i.__)("OpenAI secret key already entered.","aiwriter")," ",(0,e.createElement)(n.Button,{variant:"link",onClick:()=>_("")},(0,i.__)("Edit","aiwriter")))):(0,e.createElement)(n.TextControl,{onChange:function(e){_(e),g(e)},value:"ENCRYPTED"===w?"":w,placeholder:a?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===w?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("OpenAi API Key","aiwriter"),key:"activation-code"}),""!==w||a?null:(0,e.createElement)("p",{key:"openai-api-keys"},(0,e.createElement)("a",{href:"https://platform.openai.com/account/api-keys",target:"_blank"},(0,i.__)("Don't have a secret key yet? Click here.","aiwriter"))),a?(0,e.createElement)(n.Spinner,null):null),(0,e.createElement)(n.PanelBody,{title:(0,i.__)("FAQ & Features","aiwriter"),initialOpen:!1},(0,e.createElement)("ul",null,(0,e.createElement)("li",null,(0,e.createElement)(n.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriter.space/faq.html"},(0,i.__)("Frequently asked questions","aiwriter"))),(0,e.createElement)("li",null,(0,e.createElement)(n.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriterwp.canny.io/feature-requests"},(0,i.__)("Feature requests","aiwriter"))))))}),null),document.getElementById("aiWriterSettings")),t.render((0,e.createElement)((()=>{const{removeNotice:t}=(0,s.useDispatch)(u.store);let r=(0,s.useSelect)((e=>e(u.store).getNotices("aiWriter"))),i=r.filter((e=>{let{type:t}=e;return"snackbar"===t}));return r=r.filter((e=>{let{isDismissible:t,type:r}=e;return"default"===r})),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(n.NoticeList,{notices:r,onRemove:e=>t(e,"aiWriter"),className:"components-editor-notices__dismissible"}),(0,e.createElement)(n.SnackbarList,{notices:i,className:"components-editor-notices__snackbar",onRemove:t}))}),null),document.getElementById("aiWriterNotices"))})()})(); -
aiwriter/trunk/readme.txt
r2872577 r2880249 1 === AiWriter: ChatGPT-like content generation ===1 === AiWriter: Ai Content Generation === 2 2 Contributors: floriansimeth 3 Tags: gpt3, chat-gpt, ai, gpt, gpt-3 content creation, content generation, content automation, openai3 Tags: ai content creation, content generation, content automation, ai plugin, ai, gpt3, chat-gpt, gpt, gpt-3 4 4 Tested up to: 6.1.1 5 Stable tag: 0. 7.25 Stable tag: 0.8.0 6 6 Requires PHP: 8.0 7 7 Requires at least: 6.0 … … 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Unleash the Power of GPT-3 with AiWriter the same technology that is used by ChatGPT.12 Streamline your content creation with AI-powered writing: The Ultimate AiWriter WordPress Plugin for Bloggers and Writers. 13 13 14 14 == Description == 15 15 16 AiWriter is a revolutionary WordPress plugin that uses AI technology (mostly powered by GPT-3) to help you write beautiful, unique texts. GPT-3 is also used by OpenAI's chatGPT and many other tools. 17 With AiWriter, you don't have to worry about what to write - the plugin does it for you. Just type a few words and let AiWriter do the rest after you enter three plus signs (+++). 16 Hey there 👋, welcome to AiWriter - the ultimate AI-powered WordPress plugin for all the bloggers, writers and copywriters out there! 18 17 19 AiWriter is perfect for bloggers, online entrepreneurs and anyone who wants to create high-quality content quickly and efficiently. With AiWriter, you can focus on what really matters: sharing your ideas and achieving your goals.18 If you're someone who wants to write high-quality, engaging content without spending hours brainstorming and researching, then AiWriter is perfect for you. Our AI technology does all the heavy lifting of content creation, leaving you more time to focus on the creative process. 20 19 21 Try AiWriter now and see for yourself how easy and powerful writing content can be! 20 === Ai Content Generation === 22 21 23 === Generate Content === 22 With AiWriter, you can create unique, SEO-optimised content quickly and efficiently. All you have to do is type '+++' and let the magic happen! Our advanced ChatGPT language model is there to help you create content that is not only unique, but also engaging and informative. 24 23 25 - Simply type +++ and AiWriter will add more text to your content. 26 - OpenAI's Completions API, powered by the advanced ChatGPT language model, unlocks the full potential of conversational AI. 27 - Enhance WordPress with the unmatched accuracy and efficiency of ChatGPT's natural language processing capabilities. 28 - Experience a new level of language understanding at your fingertips. 24 Whether you're a blogger, writer or copywriter, AiWriter is an indispensable tool that can help you streamline your workflow, save time and improve the quality of your work. Our AI for content creation capabilities help you create content that is uniquely tailored to your needs and style. 29 25 30 === AI is awesome! === 26 So what are you waiting for? Install AiWriter today and unlock the power of AI content writing in WordPress. With our plugin, you can take your content creation to the next level and produce high-quality, engaging content that your readers will love. Trust us, once you try AiWriter, you'll never go back to your old ways of creating content! 31 27 32 I think it's totally cool what you can do with AI now. My aim is to make the interfaces offered to a developer as simple as possible for WordPress users, while at the same time producing the fastest possible results. I hope you enjoy using AiWriter as much as I enjoyed developing it. - Florian 28 === The AI for Content Creation === 33 29 34 === Open AI === 30 AiWriter is powered by Chat-GPT, an advanced AI language model that uses natural language processing to generate content. Chat-GPT is a state-of-the-art AI model that can generate content that is not only unique, but also engaging and informative. With our AI-powered content creation capabilities, you can create content that is uniquely tailored to your needs and style. 35 31 36 OpenAI is a leading AI research lab dedicated to ensuring that artificial intelligence has a positive impact on humanity. Using cutting-edge technology and deep learning algorithms, OpenAI pushes the boundaries of what's possible in AI. Whether it's developing advanced language models like GPT-3 or creating new tools and platforms, OpenAI is at the forefront of the AI revolution, shaping the future of technology and innovation. 32 === Do your research right in WordPress === 33 34 Great news! As of version 0.8.0, we've integrated Chat-GPT into AiWriter, making it even more powerful and versatile. With this integration, you can now conduct comprehensive research and write content that is both informative and engaging right from within WordPress. 35 36 By using Chat-GPT, you can take advantage of AI-powered natural language processing to gain valuable insights and inspiration for your content. Whether you need to research a specific topic or find related keywords, Chat-GPT has you covered. With this integration, you can now access Chat-GPT directly from AiWriter, streamlining the process of creating high-quality content. 37 38 So if you're looking for a tool to help you create content that's not only unique, but also informative, then AiWriter is the perfect choice. With our latest update, you can now harness the power of Chat-GPT right inside WordPress and take your content creation to the next level. 37 39 38 40 === Important note === 39 41 40 Please note this is a Software-as-a-Service (SaaS) plugin. You need an [AiWriter](https://aiwriter.space) account as well as an OpenAI API key to use this plugin. However, there is a free plan available. Simply [register with the Newsletter](https://aiwriter.space/7-day-trial.html) and try AiWriter for free for 7 days .42 Please note this is a Software-as-a-Service (SaaS) plugin. You need an [AiWriter](https://aiwriter.space) account as well as an OpenAI API key to use this plugin. However, there is a free plan available. Simply [register with the Newsletter](https://aiwriter.space/7-day-trial.html) and try AiWriter for free for 7 days (without an OpenAi API key). Easy! 41 43 42 44 == Installation == … … 52 54 === Does it work with Classic Editor? === 53 55 54 Yes, it can be used with the classic editor as well. However, we recommend using the block editor.56 Yes, it can be used with the Classic Editor as well. However, we recommend using the block editor. 55 57 56 58 === How to get an activation key? ===
Note: See TracChangeset
for help on using the changeset viewer.