Changeset 2972048
- Timestamp:
- 09/27/2023 06:10:11 AM (3 years ago)
- Location:
- aiwriter
- Files:
-
- 20 edited
- 1 copied
-
tags/0.10.1 (copied) (copied from aiwriter/trunk)
-
tags/0.10.1/aiwriter.php (modified) (9 diffs)
-
tags/0.10.1/build/blockEditor.asset.php (modified) (1 diff)
-
tags/0.10.1/build/blockEditor.js (modified) (1 diff)
-
tags/0.10.1/build/chatWindow.asset.php (modified) (1 diff)
-
tags/0.10.1/build/chatWindow.css (modified) (1 diff)
-
tags/0.10.1/build/classicEditor.asset.php (modified) (1 diff)
-
tags/0.10.1/build/classicEditor.js (modified) (1 diff)
-
tags/0.10.1/languages/de_DE.mo (modified) (previous)
-
tags/0.10.1/languages/de_DE.po (modified) (11 diffs)
-
tags/0.10.1/readme.txt (modified) (2 diffs)
-
trunk/aiwriter.php (modified) (9 diffs)
-
trunk/build/blockEditor.asset.php (modified) (1 diff)
-
trunk/build/blockEditor.js (modified) (1 diff)
-
trunk/build/chatWindow.asset.php (modified) (1 diff)
-
trunk/build/chatWindow.css (modified) (1 diff)
-
trunk/build/classicEditor.asset.php (modified) (1 diff)
-
trunk/build/classicEditor.js (modified) (1 diff)
-
trunk/languages/de_DE.mo (modified) (previous)
-
trunk/languages/de_DE.po (modified) (11 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
aiwriter/tags/0.10.1/aiwriter.php
r2904217 r2972048 2 2 /** 3 3 * Plugin Name: AiWriter 4 * Description: When the AI completes your sentence... Register at https://aiwriter.space to use this plugin! Thanks.4 * Description: Automatic WordPress AI Writer, Copywriting Assistant & Content Repurposer 5 5 * Requires at least: 6.2 6 6 * Requires PHP: 8.0.0 7 * Version: 0. 9.07 * Version: 0.10.1 8 8 * Author: floriansimeth 9 9 * License: GPL-2.0-or-later … … 23 23 use WP_REST_Response; 24 24 25 define( 'AIWRITER_API_URL', 'https://a iwriter.space/api/' );25 define( 'AIWRITER_API_URL', 'https://api.aiwriter.space/api/' ); 26 26 define( 'AIWRITER_STREAM_URL', 'https://stream.aiwriter.workers.dev' ); 27 27 … … 39 39 */ 40 40 function registerSettings(): void { 41 42 $cryptoHelper = static function ( $value ) { 43 static $cryptoValue = null; 44 45 # avoid double encryption 46 if ( is_string( $cryptoValue ) ) { 47 return $cryptoValue; 48 } 49 50 $cryptoValue = cryptoHelper( $value ); 51 52 return $cryptoValue; 53 }; 54 41 55 register_setting( 42 56 'options', … … 44 58 [ 45 59 'type' => 'string', 46 'sanitize_callback' => '\wpbuddy\ai_writer\cryptoHelper',60 'sanitize_callback' => $cryptoHelper, 47 61 'show_in_rest' => true, 48 62 'default' => '' … … 55 69 [ 56 70 'type' => 'string', 57 'sanitize_callback' => '\wpbuddy\ai_writer\cryptoHelper',71 'sanitize_callback' => $cryptoHelper, 58 72 'show_in_rest' => true, 59 73 'default' => '' … … 222 236 'ai-writer-no-license-information', 223 237 sprintf( 224 __( 'Hey %s, it looks like you haven\'t added your licence information yet. Enter the licence key in the settings (on the right side) and you\'re good to go.', 'aiwriter' ),238 __( 'Hey %s, it looks like you haven\'t added your licence information yet. Enter the licence key / purchase code in the settings (on the right side) and you\'re good to go.', 'aiwriter' ), 225 239 getCurrentUserFirstname() 226 240 ), … … 257 271 ); 258 272 } 273 } else { 274 $openAiSecretKey = ''; 259 275 } 260 276 … … 351 367 'ai-writer-no-license-information', 352 368 sprintf( 353 __( 'Hey %s, it looks like you haven\'t added your licence information yet. Enter the licence key in the settings (on the right side) and you\'re good to go.', 'aiwriter' ),369 __( 'Hey %s, it looks like you haven\'t added your licence information yet. Enter the licence key / purchase code in the settings (on the right side) and you\'re good to go.', 'aiwriter' ), 354 370 getCurrentUserFirstname() 355 371 ), … … 376 392 377 393 $body = [ 378 'model' => " text-davinci-003",394 'model' => "gpt-3.5-turbo-instruct", 379 395 'prompt' => $request->get_param( 'prompt' ), 380 396 'temperature' => (float) $request->get_param( 'temperature' ), -
aiwriter/tags/0.10.1/build/blockEditor.asset.php
r2904217 r2972048 1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices', 'wp-plugins'), 'version' => ' 2ebe319528d7be03c835');1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices', 'wp-plugins'), 'version' => '10fc2ff2475dd6102c0e'); -
aiwriter/tags/0.10.1/build/blockEditor.js
r2904217 r2972048 1 !function(){var e={705:function(e,t,r){var i=r(639).Symbol;e.exports=i},239:function(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:function(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:function(e,t,r){var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=i},607:function(e,t,r){var i=r(705),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,c=i?i.toStringTag:void 0;e.exports=function(e){var t=a.call(e,c),r=e[c];try{e[c]=void 0;var i=!0}catch(e){}var n=o.call(e);return i&&(t?e[c]=r:delete e[c]),n}},333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},639:function(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:function(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},279:function(e,t,r){var i=r(218),n=r(771),a=r(841),o=Math.max,c=Math.min;e.exports=function(e,t,r){var l,s,u,p,d,w,m=0,f=!1,v=!1,_=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var r=l,i=s;return l=s=void 0,m=t,p=e.apply(i,r)}function C(e){var r=e-w;return void 0===w||r>=t||r<0||v&&e-m>=u}function h(){var e=n();if(C(e))return E(e);d=setTimeout(h,function(e){var r=t-(e-w);return v?c(r,u-(e-m)):r}(e))}function E(e){return d=void 0,_&&l?g(e):(l=s=void 0,p)}function y(){var e=n(),r=C(e);if(l=arguments,s=this,w=e,r){if(void 0===d)return function(e){return m=e,d=setTimeout(h,t),f?g(e):p}(w);if(v)return clearTimeout(d),d=setTimeout(h,t),g(w)}return void 0===d&&(d=setTimeout(h,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:_),y.cancel=function(){void 0!==d&&clearTimeout(d),m=0,l=w=s=d=void 0},y.flush=function(){return void 0===d?p:E(n())},y}},218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},448:function(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:function(e,t,r){var i=r(639);e.exports=function(){return i.Date.now()}},841:function(e,t,r){var i=r(561),n=r(218),a=r(448),o=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^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=c.test(e);return r||l.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=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";window.React;var e=window.wp.plugins,t=window.wp.element,i=window.wp.i18n,n=window.wp.editPost,a=window.wp.components;const 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 c=r(279),l=r.n(c),s=window.wp.apiFetch,u=r.n(s),p=window.wp.data,d=window.wp.notices;const w=()=>{let{AiWriter:e}=window;const[r,n]=(0,t.useState)(!1),[o,c]=(0,t.useState)(e.isActive),[s,w]=(0,t.useState)(e.temperature),[m,f]=(0,t.useState)(e.textLength),v=l()(g,2e3),{createErrorNotice:_}=(0,p.useDispatch)(d.store);function g(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),_(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:()=>{c((e=>!e)),e.isActive=!o,g("isActive",e.isActive)}})," ",(0,i.__)("Activate AiWriter","aiwriter")),(0,t.createElement)(a.RangeControl,{label:(0,i.__)("Creativity","aiwriter"),value:s,onChange:e=>{w(e),v("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=>{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}))},m=()=>{const[e,r]=(0,t.useState)(!1),[n,o]=(0,t.useState)([]),{AiWriter:c}=window,{suggestTitles:l}=c;return(0,t.createElement)(a.PanelBody,{title:(0,i.__)("Title Suggestions","aiwriter"),initialOpen:!1,onToggle:async()=>{if(e)return;if(n.length>0)return;r(!0);let t=await l();o([...t]),r(!1)}},e&&(0,t.createElement)(a.Spinner,null),(0,t.createElement)("ul",null,n.map(((e,r)=>(0,t.createElement)("li",{key:r},(0,t.createElement)(a.Button,{onClick:()=>{(0,p.dispatch)("core/editor").editPost({title:e})},variant:"link"},e))))))},f=()=>{let{AiWriter:e}=window;const{events:r}=e,[n,o]=(0,t.useState)(!1),[c,s]=(0,t.useState)(e.isBlockAiActive),[f,v]=(0,t.useState)(""),[_,g]=(0,t.useState)(""),{createErrorNotice:C}=(0,p.useDispatch)(d.store),h=l()((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),E=l()((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)(m,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.__)("Block Ai","aiwriter"),initialOpen:!1},(0,t.createElement)("p",null,(0,t.createElement)(a.FormToggle,{checked:c,onChange:t=>{s(t.target.checked),e.isBlockAiActive=t.target.checked,((t,r)=>{let i={};i["aiwriter_"+t]=r,o(!0),u()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{e[t]=r,o(!1)})).catch((t=>{e.debug&&console.error(t),o(!1),C(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1})}))})("isBlockAiActive",t.target.checked)}})," ",(0,i.__)("Activate BlockAi (Experimental)","aiwriter"))),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("Your subscription","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==f)return;o(!0);const{editorType:t}=window.AiWriter;u()({path:"/wp/v2/settings?option_name=aiwriter%2Factivation_code",method:"GET"}).then((e=>{v(""!==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"===f?(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:()=>v("")},(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){v(e),h(e)},value:"ENCRYPTED"===f?"":f,placeholder:n?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===f?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("Activation code","aiwriter"),key:"activation-code"}),""!==f||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(""!==_)return;const{editorType:t}=window.AiWriter;o(!0),u()({path:"/wp/v2/settings?option_name=aiwriter%2Fopenai_secret_key",method:"GET"}).then((e=>{g(""!==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"===_?(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:()=>g("")},(0,i.__)("Edit","aiwriter")))):(0,t.createElement)(a.TextControl,{onChange:function(e){g(e),E(e)},value:"ENCRYPTED"===_?"":_,placeholder:n?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===_?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("OpenAi API Key","aiwriter"),key:"activation-code"}),""!==_||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"))))))};window.wp.blocks,window.wp.hooks,window.wp.compose,window.wp.blockEditor;const v=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)(f,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 !function(){var e={705:function(e,t,r){var i=r(639).Symbol;e.exports=i},239:function(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:function(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:function(e,t,r){var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=i},607:function(e,t,r){var i=r(705),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,c=i?i.toStringTag:void 0;e.exports=function(e){var t=a.call(e,c),r=e[c];try{e[c]=void 0;var i=!0}catch(e){}var n=o.call(e);return i&&(t?e[c]=r:delete e[c]),n}},333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},639:function(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:function(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},279:function(e,t,r){var i=r(218),n=r(771),a=r(841),o=Math.max,c=Math.min;e.exports=function(e,t,r){var l,s,u,p,d,w,m=0,f=!1,v=!1,_=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var r=l,i=s;return l=s=void 0,m=t,p=e.apply(i,r)}function g(e){var r=e-w;return void 0===w||r>=t||r<0||v&&e-m>=u}function C(){var e=n();if(g(e))return E(e);d=setTimeout(C,function(e){var r=t-(e-w);return v?c(r,u-(e-m)):r}(e))}function E(e){return d=void 0,_&&l?h(e):(l=s=void 0,p)}function y(){var e=n(),r=g(e);if(l=arguments,s=this,w=e,r){if(void 0===d)return function(e){return m=e,d=setTimeout(C,t),f?h(e):p}(w);if(v)return clearTimeout(d),d=setTimeout(C,t),h(w)}return void 0===d&&(d=setTimeout(C,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:_),y.cancel=function(){void 0!==d&&clearTimeout(d),m=0,l=w=s=d=void 0},y.flush=function(){return void 0===d?p:E(n())},y}},218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},448:function(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:function(e,t,r){var i=r(639);e.exports=function(){return i.Date.now()}},841:function(e,t,r){var i=r(561),n=r(218),a=r(448),o=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^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=c.test(e);return r||l.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=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";window.React;var e=window.wp.plugins,t=window.wp.element,i=window.wp.i18n,n=window.wp.editPost,a=window.wp.components;const 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 c=r(279),l=r.n(c),s=window.wp.apiFetch,u=r.n(s),p=window.wp.data,d=window.wp.notices;const w=()=>{let{AiWriter:e}=window;const[r,n]=(0,t.useState)(!1),[o,c]=(0,t.useState)(e.isActive),[s,w]=(0,t.useState)(e.temperature),[m,f]=(0,t.useState)(e.textLength),v=l()(h,2e3),{createErrorNotice:_}=(0,p.useDispatch)(d.store);function h(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),_(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:()=>{c((e=>!e)),e.isActive=!o,h("isActive",e.isActive)}})," ",(0,i.__)("Activate AiWriter","aiwriter")),(0,t.createElement)(a.RangeControl,{label:(0,i.__)("Creativity","aiwriter"),value:s,onChange:e=>{w(e),v("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=>{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}))},m=()=>{const[e,r]=(0,t.useState)(!1),[n,o]=(0,t.useState)([]),{AiWriter:c}=window,{suggestTitles:l}=c;return(0,t.createElement)(a.PanelBody,{title:(0,i.__)("Title Suggestions","aiwriter"),initialOpen:!1,onToggle:async()=>{if(e)return;if(n.length>0)return;r(!0);let t=await l();o([...t]),r(!1)}},e&&(0,t.createElement)(a.Spinner,null),(0,t.createElement)("ul",null,n.map(((e,r)=>(0,t.createElement)("li",{key:r},(0,t.createElement)(a.Button,{onClick:()=>{(0,p.dispatch)("core/editor").editPost({title:e})},variant:"link"},e))))))},f=()=>{let{AiWriter:e}=window;const{events:r}=e,[n,o]=(0,t.useState)(!1),[c,s]=(0,t.useState)(e.isBlockAiActive),[f,v]=(0,t.useState)(""),[_,h]=(0,t.useState)(""),{createErrorNotice:g}=(0,p.useDispatch)(d.store),C=l()((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),g(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===r?"aiWriter":"global"})}))}),1e3),E=l()((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":t}}).then((e=>{o(!1)})).catch((t=>{e.debug&&console.error(t),o(!1),g(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)(m,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.__)("Block Ai","aiwriter"),initialOpen:!1},(0,t.createElement)("p",null,(0,t.createElement)(a.FormToggle,{checked:c,onChange:t=>{s(t.target.checked),e.isBlockAiActive=t.target.checked,((t,r)=>{let i={};i["aiwriter_"+t]=r,o(!0),u()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{e[t]=r,o(!1)})).catch((t=>{e.debug&&console.error(t),o(!1),g(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1})}))})("isBlockAiActive",t.target.checked)}})," ",(0,i.__)("Activate BlockAi (Experimental)","aiwriter"))),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("Your license","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==f)return;o(!0);const{editorType:t}=window.AiWriter;u()({path:"/wp/v2/settings?option_name=aiwriter%2Factivation_code",method:"GET"}).then((e=>{v(""!==e["aiwriter/activation_code"]?"ENCRYPTED":""),o(!1)})).catch((r=>{e.debug&&console.error(r),o(!1),g(sprintf("Error: %s (%s)",r.message,r.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===t?"aiWriter":"global"})}))}},"ENCRYPTED"===f?(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:()=>v("")},(0,i.__)("Edit","aiwriter")))):(0,t.createElement)(a.TextControl,{onChange:function(e){v(e),C(e)},value:"ENCRYPTED"===f?"":f,placeholder:n?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===f?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("Activation code","aiwriter"),key:"activation-code"}),""!==f||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)("p",null,(0,t.createElement)("a",{href:"https://wp-buddy.com/blog/where-to-find-your-envato-purchase-code/",target:"_blank"},(0,i.__)("Where to find your Envato purchase code","aiwriter")))),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("OpenAi","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==_)return;const{editorType:t}=window.AiWriter;o(!0),u()({path:"/wp/v2/settings?option_name=aiwriter%2Fopenai_secret_key",method:"GET"}).then((e=>{h(""!==e["aiwriter/openai_secret_key"]?"ENCRYPTED":""),o(!1)})).catch((r=>{e.debug&&console.error(r),o(!1),g(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"===_?(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:()=>h("")},(0,i.__)("Edit","aiwriter")))):(0,t.createElement)(a.TextControl,{onChange:function(e){h(e),E(e)},value:"ENCRYPTED"===_?"":_,placeholder:n?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===_?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("OpenAi API Key","aiwriter"),key:"activation-code"}),""!==_||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"))))))};window.wp.blocks,window.wp.hooks,window.wp.compose,window.wp.blockEditor;const v=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)(f,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.10.1/build/chatWindow.asset.php
r2904217 r2972048 1 <?php return array('dependencies' => array('react', 'wp-dom-ready'), 'version' => ' e9ae515b91c3fd8fcd9d');1 <?php return array('dependencies' => array('react', 'wp-dom-ready'), 'version' => '6ffef729b427738e3fd2'); -
aiwriter/tags/0.10.1/build/chatWindow.css
r2904217 r2972048 1 .aiwriter-chatwindow{background-color:#fff;box-shadow:0 0 10px rgba(0,0,0,.498);display:flex;flex-direction:column;height:calc(100vh - 4rem);justify-content:space-between;max-width:80%;min-width:900px;outline:3px solid #480693;padding:2rem;position:absolute;right:0;top:0;width:50%}@media(max-width:900px){.aiwriter-chatwindow{min-width:calc(100vw - 4rem);z-index:9999}}.aiwriter-chatwindow h1{flex:1 0 auto;padding:0 1rem}.aiwriter-chatwindow.hidden{display:none}.aiwriter-chatwindow .aiwriter-chatwindow__footer,.aiwriter-chatwindow .aiwriter-chatwindow__header{display:flex;gap:.5rem;justify-content:space-between}.aiwriter-chatwindow .aiwriter-chatwindow__footer{align-items:flex-end}.aiwriter-chatwindow .aiwriter-chatwindow__footer .aiwriter-chatwindow__footer__prompt{flex:1 1 auto;margin-bottom:0}.aiwriter-chatwindow .aiwriter-chatwindow__footer button{margin-bottom:.7rem}.aiwriter-chatwindow .aiwriter-chatwindow__body{height:100%;overflow-x:auto}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message{border-left:2px solid transparent;display:flex;flex-direction:row;font-size:.9rem;justify-content:space-between;line-height:1.3rem;padding:1rem}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message pre{background-color:#000;color:#fff}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message table,.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message table td,.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message table th{border:1px solid #000;padding:.5em}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message table{border-collapse:collapse;margin:.5em 0}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message p{font-size:1rem;margin:0}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message div{flex:0 1 auto;margin-left:1rem }.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message.referred{border-left:2px solid #480693}.aiwriter-chatwindow .aiwriter-chatwindow__body>.aiwriter-chatwindow__body__message:nth-child(2n){border-bottom:1px solid rgba(0,0,0,.098);border-top:1px solid rgba(0,0,0,.098)}.aiwriter-chatwindow .aiwriter-chatwindow__body>.aiwriter-chatwindow__body__message.assistant{background-color:#f7f7f8}.aiwriter-chatwindow .aiwriter-chatwindow__body .ai-loader{display:block;margin:1rem}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body_stop{display:flex}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body_stop button{align-self:center}1 .aiwriter-chatwindow{background-color:#fff;box-shadow:0 0 10px rgba(0,0,0,.498);display:flex;flex-direction:column;height:calc(100vh - 4rem);justify-content:space-between;max-width:80%;min-width:900px;outline:3px solid #480693;padding:2rem;position:absolute;right:0;top:0;width:50%}@media(max-width:900px){.aiwriter-chatwindow{min-width:calc(100vw - 4rem);z-index:9999}}.aiwriter-chatwindow h1{flex:1 0 auto;padding:0 1rem}.aiwriter-chatwindow.hidden{display:none}.aiwriter-chatwindow .aiwriter-chatwindow__footer,.aiwriter-chatwindow .aiwriter-chatwindow__header{display:flex;gap:.5rem;justify-content:space-between}.aiwriter-chatwindow .aiwriter-chatwindow__footer{align-items:flex-end}.aiwriter-chatwindow .aiwriter-chatwindow__footer .aiwriter-chatwindow__footer__prompt{flex:1 1 auto;margin-bottom:0}.aiwriter-chatwindow .aiwriter-chatwindow__footer button{margin-bottom:.7rem}.aiwriter-chatwindow .aiwriter-chatwindow__body{height:100%;overflow-x:auto}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message{border-left:2px solid transparent;display:flex;flex-direction:row;font-size:.9rem;justify-content:space-between;line-height:1.3rem;padding:1rem}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message pre{background-color:#000;color:#fff}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message table,.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message table td,.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message table th{border:1px solid #000;padding:.5em}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message table{border-collapse:collapse;margin:.5em 0}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message p{font-size:1rem;margin:0}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message div{flex:0 1 auto;margin-left:1rem;white-space:pre-line}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message.referred{border-left:2px solid #480693}.aiwriter-chatwindow .aiwriter-chatwindow__body>.aiwriter-chatwindow__body__message:nth-child(2n){border-bottom:1px solid rgba(0,0,0,.098);border-top:1px solid rgba(0,0,0,.098)}.aiwriter-chatwindow .aiwriter-chatwindow__body>.aiwriter-chatwindow__body__message.assistant{background-color:#f7f7f8}.aiwriter-chatwindow .aiwriter-chatwindow__body .ai-loader{display:block;margin:1rem}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body_stop{display:flex}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body_stop button{align-self:center} -
aiwriter/tags/0.10.1/build/classicEditor.asset.php
r2904217 r2972048 1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices'), 'version' => ' ececf369cc9ab3b7ffd7');1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices'), 'version' => 'cc0470255dcba7ccc6d9'); -
aiwriter/tags/0.10.1/build/classicEditor.js
r2904217 r2972048 1 !function(){var e={705:function(e,t,r){var i=r(639).Symbol;e.exports=i},239:function(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:function(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:function(e,t,r){var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=i},607:function(e,t,r){var i=r(705),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,c=i?i.toStringTag:void 0;e.exports=function(e){var t=a.call(e,c),r=e[c];try{e[c]=void 0;var i=!0}catch(e){}var n=o.call(e);return i&&(t?e[c]=r:delete e[c]),n}},333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},639:function(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:function(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},279:function(e,t,r){var i=r(218),n=r(771),a=r(841),o=Math.max,c=Math.min;e.exports=function(e,t,r){var l,s,u,p, m,d,f=0,w=!1,_=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var r=l,i=s;return l=s=void 0,f=t,p=e.apply(i,r)}function h(e){var r=e-d;return void 0===d||r>=t||r<0||_&&e-f>=u}function E(){var e=n();if(h(e))return y(e);m=setTimeout(E,function(e){var r=t-(e-d);return _?c(r,u-(e-f)):r}(e))}function y(e){return m=void 0,v&&l?g(e):(l=s=void 0,p)}function b(){var e=n(),r=h(e);if(l=arguments,s=this,d=e,r){if(void 0===m)return function(e){return f=e,m=setTimeout(E,t),w?g(e):p}(d);if(_)return clearTimeout(m),m=setTimeout(E,t),g(d)}return void 0===m&&(m=setTimeout(E,t)),p}return t=a(t)||0,i(r)&&(w=!!r.leading,u=(_="maxWait"in r)?o(a(r.maxWait)||0,t):u,v="trailing"in r?!!r.trailing:v),b.cancel=function(){void 0!==m&&clearTimeout(m),f=0,l=d=s=m=void 0},b.flush=function(){return void 0===m?p:y(n())},b}},218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},448:function(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:function(e,t,r){var i=r(639);e.exports=function(){return i.Date.now()}},841:function(e,t,r){var i=r(561),n=r(218),a=r(448),o=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^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=c.test(e);return r||l.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=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=window.wp.element,t=(window.React,window.wp.i18n),i=window.wp.components,n=r(279),a=r.n(n),o=window.wp.apiFetch,c=r.n(o),l=window.wp.data,s=window.wp.notices;const u=()=>{let{AiWriter:r}=window;const[n,o]=(0,e.useState)(!1),[u,p]=(0,e.useState)(r.isActive),[m,d]=(0,e.useState)(r.temperature),[f,w]=(0,e.useState)(r.textLength),_=a()(g,2e3),{createErrorNotice:v}=(0,l.useDispatch)(s.store);function g(e,t){let i={};i["aiwriter_"+e]=t,o(!0),c()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{r[e]=t,o(!1)})).catch((e=>{r.debug&&console.error(e),o(!1),v(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1})}))}return(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Text generation settings","aiwriter")},(0,e.createElement)("p",null,(0,e.createElement)(i.FormToggle,{checked:u,onChange:()=>{p((e=>!e)),r.isActive=!u,g("isActive",r.isActive)}})," ",(0,t.__)("Activate AiWriter","aiwriter")),(0,e.createElement)(i.RangeControl,{label:(0,t.__)("Creativity","aiwriter"),value:m,onChange:e=>{d(e),_("temperature",e)},min:0,max:2,step:.1,withInputField:!1,renderTooltipContent:e=>e<=0?(0,t.__)("Not creative at all","aiwriter"):e>=.8?(0,t.__)("Very creative","aiwriter"):e>=.5?(0,t.__)("Reasonably creative","aiwriter"):e<.5?(0,t.__)("Rather less creative","aiwriter"):void 0}),(0,e.createElement)(i.RangeControl,{label:(0,t.__)("Max. text length","aiwriter"),value:f,onChange:e=>{w(e),_("textLength",e)},min:200,max:1e3,showTooltip:!1,marks:[{value:200,label:(0,t.__)("Little","aiwriter")},{value:400,label:(0,t.__)("Medium","aiwriter")},{value:600,label:(0,t.__)("Long","aiwriter")},{value:800,label:(0,t.__)("Very long","aiwriter")},{value:1e3,label:(0,t.__)("Maximum","aiwriter")}],step:200,withInputField:!1}))},p=()=>{const[r,n]=(0,e.useState)(!1),[a,o]=(0,e.useState)([]),{AiWriter:c}=window,{suggestTitles:s}=c;return(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Title Suggestions","aiwriter"),initialOpen:!1,onToggle:async()=>{if(r)return;if(a.length>0)return;n(!0);let e=await s();o([...e]),n(!1)}},r&&(0,e.createElement)(i.Spinner,null),(0,e.createElement)("ul",null,a.map(((t,r)=>(0,e.createElement)("li",{key:r},(0,e.createElement)(i.Button,{onClick:()=>{(0,l.dispatch)("core/editor").editPost({title:t})},variant:"link"},t))))))},m=()=>{let{AiWriter:r}=window;const{events:n}=r,[o,m]=(0,e.useState)(!1),[d,f]=(0,e.useState)(r.isBlockAiActive),[w,_]=(0,e.useState)(""),[v,g]=(0,e.useState)(""),{createErrorNotice:h}=(0,l.useDispatch)(s.store),E=a()((function(e){if(""===e)return;const{editorType:t}=window.AiWriter;m(!0),c()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/activation_code","aiwriter/activation_code":e}}).then((e=>{m(!1)})).catch((e=>{r.debug&&console.error(e),m(!1),h(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===t?"aiWriter":"global"})}))}),1e3),y=a()((function(e){if(""===e)return;const{editorType:t}=window.AiWriter;m(!0),c()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/openai_secret_key","aiwriter/openai_secret_key":code}}).then((e=>{m(!1)})).catch((e=>{r.debug&&console.error(e),m(!1),h(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===t?"aiWriter":"global"})}))}),1e3);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(p,null),(0,e.createElement)(u,null),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Ai Chat","aiwriter"),initialOpen:!0},(0,e.createElement)(i.Button,{icon:"format-chat",variant:"primary",onClick:()=>{n.dispatch("aiWriter.chatOpen",!0)}},(0,t.__)("Start Ai Chat","aiwriter"))),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Block Ai","aiwriter"),initialOpen:!1},(0,e.createElement)("p",null,(0,e.createElement)(i.FormToggle,{checked:d,onChange:e=>{f(e.target.checked),r.isBlockAiActive=e.target.checked,((e,t)=>{let i={};i["aiwriter_"+e]=t,m(!0),c()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{r[e]=t,m(!1)})).catch((e=>{r.debug&&console.error(e),m(!1),h(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1})}))})("isBlockAiActive",e.target.checked)}})," ",(0,t.__)("Activate BlockAi (Experimental)","aiwriter"))),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Your subscription","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==w)return;m(!0);const{editorType:e}=window.AiWriter;c()({path:"/wp/v2/settings?option_name=aiwriter%2Factivation_code",method:"GET"}).then((e=>{_(""!==e["aiwriter/activation_code"]?"ENCRYPTED":""),m(!1)})).catch((t=>{r.debug&&console.error(t),m(!1),h(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===e?"aiWriter":"global"})}))}},"ENCRYPTED"===w?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,t.__)("Activation code already entered.","aiwriter")," ",(0,e.createElement)(i.Button,{variant:"link",onClick:()=>_("")},(0,t.__)("Edit","aiwriter"))),(0,e.createElement)("p",null,(0,e.createElement)("a",{href:"https://billing.aiwriter.space/p/login/aEU4jGfC87qg7NSaEE",target:"_blank"},(0,t.__)("Manage your subscription","aiwriter")))):(0,e.createElement)(i.TextControl,{onChange:function(e){_(e),E(e)},value:"ENCRYPTED"===w?"":w,placeholder:o?(0,t.__)("Loading code ...","aiwriter"):"ENCRYPTED"===w?(0,t.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,t.__)("Activation code","aiwriter"),key:"activation-code"}),""!==w||o?null:(0,e.createElement)("p",{key:"buy-now"},(0,e.createElement)("a",{href:"https://aiwriter.space",target:"_blank"},(0,t.__)("Don't have an activation code yet? Click here.","aiwriter"))),o?(0,e.createElement)(i.Spinner,null):null),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("OpenAi","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==v)return;const{editorType:e}=window.AiWriter;m(!0),c()({path:"/wp/v2/settings?option_name=aiwriter%2Fopenai_secret_key",method:"GET"}).then((e=>{g(""!==e["aiwriter/openai_secret_key"]?"ENCRYPTED":""),m(!1)})).catch((t=>{r.debug&&console.error(t),m(!1),h(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===e?"aiWriter":"global"})}))}},(0,e.createElement)("p",{key:"openai-api-descriptions"},(0,t.__)("After the free trial period, you will need a secret key from OpenAI for this plugin to work properly.","aiwriter")),"ENCRYPTED"===v?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,t.__)("OpenAI secret key already entered.","aiwriter")," ",(0,e.createElement)(i.Button,{variant:"link",onClick:()=>g("")},(0,t.__)("Edit","aiwriter")))):(0,e.createElement)(i.TextControl,{onChange:function(e){g(e),y(e)},value:"ENCRYPTED"===v?"":v,placeholder:o?(0,t.__)("Loading code ...","aiwriter"):"ENCRYPTED"===v?(0,t.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,t.__)("OpenAi API Key","aiwriter"),key:"activation-code"}),""!==v||o?null:(0,e.createElement)("p",{key:"openai-api-keys"},(0,e.createElement)("a",{href:"https://platform.openai.com/account/api-keys",target:"_blank"},(0,t.__)("Don't have a secret key yet? Click here.","aiwriter"))),o?(0,e.createElement)(i.Spinner,null):null),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("FAQ & Features","aiwriter"),initialOpen:!1},(0,e.createElement)("ul",null,(0,e.createElement)("li",null,(0,e.createElement)(i.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriter.space/faq.html"},(0,t.__)("Frequently asked questions","aiwriter"))),(0,e.createElement)("li",null,(0,e.createElement)(i.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriterwp.canny.io/feature-requests"},(0,t.__)("Feature requests","aiwriter"))))))},d=()=>{const{removeNotice:t}=(0,l.useDispatch)(s.store);let r=(0,l.useSelect)((e=>e(s.store).getNotices("aiWriter"))),n=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)(i.NoticeList,{notices:r,onRemove:e=>t(e,"aiWriter"),className:"components-editor-notices__dismissible"}),(0,e.createElement)(i.SnackbarList,{notices:n,className:"components-editor-notices__snackbar",onRemove:t}))};if(e.createRoot){const t=document.getElementById("aiWriterSettings");t&&(0,e.createRoot)(t).render((0,e.createElement)(m,null));const r=document.getElementById("aiWriterNotices");r&&(0,e.createRoot)(r).render((0,e.createElement)(d,null))}}()}();1 !function(){var e={705:function(e,t,r){var i=r(639).Symbol;e.exports=i},239:function(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:function(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:function(e,t,r){var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=i},607:function(e,t,r){var i=r(705),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,c=i?i.toStringTag:void 0;e.exports=function(e){var t=a.call(e,c),r=e[c];try{e[c]=void 0;var i=!0}catch(e){}var n=o.call(e);return i&&(t?e[c]=r:delete e[c]),n}},333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},639:function(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:function(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},279:function(e,t,r){var i=r(218),n=r(771),a=r(841),o=Math.max,c=Math.min;e.exports=function(e,t,r){var l,s,u,p,d,m,f=0,w=!1,_=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var r=l,i=s;return l=s=void 0,f=t,p=e.apply(i,r)}function g(e){var r=e-m;return void 0===m||r>=t||r<0||_&&e-f>=u}function y(){var e=n();if(g(e))return E(e);d=setTimeout(y,function(e){var r=t-(e-m);return _?c(r,u-(e-f)):r}(e))}function E(e){return d=void 0,v&&l?h(e):(l=s=void 0,p)}function b(){var e=n(),r=g(e);if(l=arguments,s=this,m=e,r){if(void 0===d)return function(e){return f=e,d=setTimeout(y,t),w?h(e):p}(m);if(_)return clearTimeout(d),d=setTimeout(y,t),h(m)}return void 0===d&&(d=setTimeout(y,t)),p}return t=a(t)||0,i(r)&&(w=!!r.leading,u=(_="maxWait"in r)?o(a(r.maxWait)||0,t):u,v="trailing"in r?!!r.trailing:v),b.cancel=function(){void 0!==d&&clearTimeout(d),f=0,l=m=s=d=void 0},b.flush=function(){return void 0===d?p:E(n())},b}},218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},448:function(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:function(e,t,r){var i=r(639);e.exports=function(){return i.Date.now()}},841:function(e,t,r){var i=r(561),n=r(218),a=r(448),o=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^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=c.test(e);return r||l.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=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=window.wp.element,t=(window.React,window.wp.i18n),i=window.wp.components,n=r(279),a=r.n(n),o=window.wp.apiFetch,c=r.n(o),l=window.wp.data,s=window.wp.notices;const u=()=>{let{AiWriter:r}=window;const[n,o]=(0,e.useState)(!1),[u,p]=(0,e.useState)(r.isActive),[d,m]=(0,e.useState)(r.temperature),[f,w]=(0,e.useState)(r.textLength),_=a()(h,2e3),{createErrorNotice:v}=(0,l.useDispatch)(s.store);function h(e,t){let i={};i["aiwriter_"+e]=t,o(!0),c()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{r[e]=t,o(!1)})).catch((e=>{r.debug&&console.error(e),o(!1),v(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1})}))}return(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Text generation settings","aiwriter")},(0,e.createElement)("p",null,(0,e.createElement)(i.FormToggle,{checked:u,onChange:()=>{p((e=>!e)),r.isActive=!u,h("isActive",r.isActive)}})," ",(0,t.__)("Activate AiWriter","aiwriter")),(0,e.createElement)(i.RangeControl,{label:(0,t.__)("Creativity","aiwriter"),value:d,onChange:e=>{m(e),_("temperature",e)},min:0,max:2,step:.1,withInputField:!1,renderTooltipContent:e=>e<=0?(0,t.__)("Not creative at all","aiwriter"):e>=.8?(0,t.__)("Very creative","aiwriter"):e>=.5?(0,t.__)("Reasonably creative","aiwriter"):e<.5?(0,t.__)("Rather less creative","aiwriter"):void 0}),(0,e.createElement)(i.RangeControl,{label:(0,t.__)("Max. text length","aiwriter"),value:f,onChange:e=>{w(e),_("textLength",e)},min:200,max:1e3,showTooltip:!1,marks:[{value:200,label:(0,t.__)("Little","aiwriter")},{value:400,label:(0,t.__)("Medium","aiwriter")},{value:600,label:(0,t.__)("Long","aiwriter")},{value:800,label:(0,t.__)("Very long","aiwriter")},{value:1e3,label:(0,t.__)("Maximum","aiwriter")}],step:200,withInputField:!1}))},p=()=>{const[r,n]=(0,e.useState)(!1),[a,o]=(0,e.useState)([]),{AiWriter:c}=window,{suggestTitles:s}=c;return(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Title Suggestions","aiwriter"),initialOpen:!1,onToggle:async()=>{if(r)return;if(a.length>0)return;n(!0);let e=await s();o([...e]),n(!1)}},r&&(0,e.createElement)(i.Spinner,null),(0,e.createElement)("ul",null,a.map(((t,r)=>(0,e.createElement)("li",{key:r},(0,e.createElement)(i.Button,{onClick:()=>{(0,l.dispatch)("core/editor").editPost({title:t})},variant:"link"},t))))))},d=()=>{let{AiWriter:r}=window;const{events:n}=r,[o,d]=(0,e.useState)(!1),[m,f]=(0,e.useState)(r.isBlockAiActive),[w,_]=(0,e.useState)(""),[v,h]=(0,e.useState)(""),{createErrorNotice:g}=(0,l.useDispatch)(s.store),y=a()((function(e){if(""===e)return;const{editorType:t}=window.AiWriter;d(!0),c()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/activation_code","aiwriter/activation_code":e}}).then((e=>{d(!1)})).catch((e=>{r.debug&&console.error(e),d(!1),g(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===t?"aiWriter":"global"})}))}),1e3),E=a()((function(e){if(""===e)return;const{editorType:t}=window.AiWriter;d(!0),c()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/openai_secret_key","aiwriter/openai_secret_key":e}}).then((e=>{d(!1)})).catch((e=>{r.debug&&console.error(e),d(!1),g(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===t?"aiWriter":"global"})}))}),1e3);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(p,null),(0,e.createElement)(u,null),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Ai Chat","aiwriter"),initialOpen:!0},(0,e.createElement)(i.Button,{icon:"format-chat",variant:"primary",onClick:()=>{n.dispatch("aiWriter.chatOpen",!0)}},(0,t.__)("Start Ai Chat","aiwriter"))),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Block Ai","aiwriter"),initialOpen:!1},(0,e.createElement)("p",null,(0,e.createElement)(i.FormToggle,{checked:m,onChange:e=>{f(e.target.checked),r.isBlockAiActive=e.target.checked,((e,t)=>{let i={};i["aiwriter_"+e]=t,d(!0),c()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{r[e]=t,d(!1)})).catch((e=>{r.debug&&console.error(e),d(!1),g(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1})}))})("isBlockAiActive",e.target.checked)}})," ",(0,t.__)("Activate BlockAi (Experimental)","aiwriter"))),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Your license","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==w)return;d(!0);const{editorType:e}=window.AiWriter;c()({path:"/wp/v2/settings?option_name=aiwriter%2Factivation_code",method:"GET"}).then((e=>{_(""!==e["aiwriter/activation_code"]?"ENCRYPTED":""),d(!1)})).catch((t=>{r.debug&&console.error(t),d(!1),g(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===e?"aiWriter":"global"})}))}},"ENCRYPTED"===w?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,t.__)("Activation code already entered.","aiwriter")," ",(0,e.createElement)(i.Button,{variant:"link",onClick:()=>_("")},(0,t.__)("Edit","aiwriter")))):(0,e.createElement)(i.TextControl,{onChange:function(e){_(e),y(e)},value:"ENCRYPTED"===w?"":w,placeholder:o?(0,t.__)("Loading code ...","aiwriter"):"ENCRYPTED"===w?(0,t.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,t.__)("Activation code","aiwriter"),key:"activation-code"}),""!==w||o?null:(0,e.createElement)("p",{key:"buy-now"},(0,e.createElement)("a",{href:"https://aiwriter.space",target:"_blank"},(0,t.__)("Don't have an activation code yet? Click here.","aiwriter"))),o?(0,e.createElement)(i.Spinner,null):null,(0,e.createElement)("p",null,(0,e.createElement)("a",{href:"https://wp-buddy.com/blog/where-to-find-your-envato-purchase-code/",target:"_blank"},(0,t.__)("Where to find your Envato purchase code","aiwriter")))),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("OpenAi","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==v)return;const{editorType:e}=window.AiWriter;d(!0),c()({path:"/wp/v2/settings?option_name=aiwriter%2Fopenai_secret_key",method:"GET"}).then((e=>{h(""!==e["aiwriter/openai_secret_key"]?"ENCRYPTED":""),d(!1)})).catch((t=>{r.debug&&console.error(t),d(!1),g(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===e?"aiWriter":"global"})}))}},(0,e.createElement)("p",{key:"openai-api-descriptions"},(0,t.__)("After the free trial period, you will need a secret key from OpenAI for this plugin to work properly.","aiwriter")),"ENCRYPTED"===v?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,t.__)("OpenAI secret key already entered.","aiwriter")," ",(0,e.createElement)(i.Button,{variant:"link",onClick:()=>h("")},(0,t.__)("Edit","aiwriter")))):(0,e.createElement)(i.TextControl,{onChange:function(e){h(e),E(e)},value:"ENCRYPTED"===v?"":v,placeholder:o?(0,t.__)("Loading code ...","aiwriter"):"ENCRYPTED"===v?(0,t.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,t.__)("OpenAi API Key","aiwriter"),key:"activation-code"}),""!==v||o?null:(0,e.createElement)("p",{key:"openai-api-keys"},(0,e.createElement)("a",{href:"https://platform.openai.com/account/api-keys",target:"_blank"},(0,t.__)("Don't have a secret key yet? Click here.","aiwriter"))),o?(0,e.createElement)(i.Spinner,null):null),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("FAQ & Features","aiwriter"),initialOpen:!1},(0,e.createElement)("ul",null,(0,e.createElement)("li",null,(0,e.createElement)(i.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriter.space/faq.html"},(0,t.__)("Frequently asked questions","aiwriter"))),(0,e.createElement)("li",null,(0,e.createElement)(i.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriterwp.canny.io/feature-requests"},(0,t.__)("Feature requests","aiwriter"))))))},m=()=>{const{removeNotice:t}=(0,l.useDispatch)(s.store);let r=(0,l.useSelect)((e=>e(s.store).getNotices("aiWriter"))),n=r.filter((({type:e})=>"snackbar"===e));return r=r.filter((({isDismissible:e,type:t})=>"default"===t)),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(i.NoticeList,{notices:r,onRemove:e=>t(e,"aiWriter"),className:"components-editor-notices__dismissible"}),(0,e.createElement)(i.SnackbarList,{notices:n,className:"components-editor-notices__snackbar",onRemove:t}))};if(e.createRoot){const t=document.getElementById("aiWriterSettings");t&&(0,e.createRoot)(t).render((0,e.createElement)(d,null));const r=document.getElementById("aiWriterNotices");r&&(0,e.createRoot)(r).render((0,e.createElement)(m,null))}}()}(); -
aiwriter/tags/0.10.1/languages/de_DE.po
r2880249 r2972048 2 2 msgstr "" 3 3 "Project-Id-Version: AiWriter\n" 4 "POT-Creation-Date: 2023-0 3-09 14:13+0100\n"5 "PO-Revision-Date: 2023-0 3-09 14:45+0100\n"4 "POT-Creation-Date: 2023-09-18 11:41+0200\n" 5 "PO-Revision-Date: 2023-09-18 11:41+0200\n" 6 6 "Last-Translator: \n" 7 7 "Language-Team: \n" … … 11 11 "Content-Transfer-Encoding: 8bit\n" 12 12 "Plural-Forms: nplurals=2; plural=(n != 1);\n" 13 "X-Generator: Poedit 3. 2.2\n"13 "X-Generator: Poedit 3.3.2\n" 14 14 "X-Poedit-Basepath: ..\n" 15 15 "X-Poedit-Flags-xgettext: --add-comments=translators:\n" … … 28 28 29 29 #: aiwriter.php:86 30 msgid "If Block Ai functionality is active for this user." 31 msgstr "Ob die Block-AI Funktionalität für diesen Benutzer aktiviert ist." 32 33 #: aiwriter.php:104 30 34 msgid "If the onboarding process has been completed." 31 35 msgstr "Ob der Onboarding-Prozess abgeschlossen ist." 32 36 33 #: aiwriter.php:1 0437 #: aiwriter.php:122 34 38 msgid "The temperature that was set by the user. Value from 0.0 to 1.0." 35 39 msgstr "" 36 40 "Die Temperatur, die vom Benutzer eingestellt wurde. Wert von 0,0 bis 1,0." 37 41 38 #: aiwriter.php:1 2242 #: aiwriter.php:140 39 43 msgid "The text length that was set by the user. Value from 200 to 1000." 40 44 msgstr "" 41 45 "Die Textlänge, die vom Benutzer eingestellt wurde. Wert von 200 bis 1000." 42 46 43 #: aiwriter.php:2 06 aiwriter.php:33547 #: aiwriter.php:224 aiwriter.php:353 44 48 #, php-format 45 49 msgid "" … … 51 55 "rechten Seite) ein und Du kannst loslegen." 52 56 53 #: aiwriter.php:2 13 aiwriter.php:34257 #: aiwriter.php:231 aiwriter.php:360 54 58 msgid "" 55 59 "If you don't have a license key, sign up for our newsletter and gain access " … … 64 68 "exklusiven Best-Practice-Informationen." 65 69 66 #: aiwriter.php:2 26 aiwriter.php:35570 #: aiwriter.php:244 aiwriter.php:373 67 71 #, php-format 68 72 msgid "Could not decrypt your activation code. Got error: %s" … … 70 74 "Ihr Aktivierungscode konnte nicht entschlüsselt werden. Fehler erhalten: %s" 71 75 72 #: aiwriter.php:2 3876 #: aiwriter.php:256 73 77 #, php-format 74 78 msgid "Could not decrypt your Open AI Secret Key code. Got error: %s" … … 77 81 "erhalten: %s" 78 82 79 #: aiwriter.php:2 8083 #: aiwriter.php:298 80 84 #, php-format 81 85 msgid "Could not fetch token from API (wrong status code) with error: %s (%d)" … … 84 88 "%s (%d)" 85 89 86 #: aiwriter.php: 29290 #: aiwriter.php:310 87 91 #, php-format 88 92 msgid "Could not fetch token from API. Got error: %s (%d)" … … 90 94 "Das Token konnte nicht von der API geholt werden. Fehler erhalten: %s (%d)" 91 95 92 #: aiwriter.php:3 0296 #: aiwriter.php:320 93 97 msgid "Could not fetch token from API (wrong status code)." 94 98 msgstr "" 95 99 "Das Token konnte nicht von der API geholt werden (falscher Statuscode)." 96 100 97 #: aiwriter.php:3 10101 #: aiwriter.php:328 98 102 msgid "Could not fetch token from API (no string)." 99 103 msgstr "Das Token konnte nicht von der API geholt werden (kein String)." 100 104 101 #: aiwriter.php:4 07105 #: aiwriter.php:425 102 106 #, php-format 103 107 msgid "Could not fetch data from API (wrong status code) with error: %s (%d)" … … 106 110 "Fehler: %s (%d)" 107 111 108 #: aiwriter.php:4 17112 #: aiwriter.php:435 109 113 msgid "Could not fetch data from API (wrong status code)." 110 114 msgstr "" 111 115 "Es konnten keine Daten von der API abgerufen werden (falscher Statuscode)." 112 116 113 #: aiwriter.php:6 70117 #: aiwriter.php:689 114 118 msgid "Cannot decrypt." 115 119 msgstr "Keine Entschlüsselung möglich." 116 120 117 #: aiwriter.php:8 05121 #: aiwriter.php:824 118 122 msgid "AiWriter Settings" 119 123 msgstr "AiWriter Einstellungen" … … 125 129 #. Description of the plugin/theme 126 130 msgid "" 127 "When the AI completes your sentence... Register at https://aiwriter.space to " 128 "use this plugin! Thanks." 131 "Automatic WordPress AI Writer, Copywriting Assistant & Content Repurposer" 129 132 msgstr "" 130 "Wenn die KI Deinen Satz vervollständigt… Registriere dich unter https://"131 "aiwriter.space, um dieses Plugin zu nutzen! Vielen Dank."132 133 133 134 #. Author of the plugin/theme 134 135 msgid "floriansimeth" 135 136 msgstr "" 137 138 #~ msgid "" 139 #~ "When the AI completes your sentence... Register at https://aiwriter.space " 140 #~ "to use this plugin! Thanks." 141 #~ msgstr "" 142 #~ "Wenn die KI Deinen Satz vervollständigt… Registriere dich unter https://" 143 #~ "aiwriter.space, um dieses Plugin zu nutzen! Vielen Dank." -
aiwriter/tags/0.10.1/readme.txt
r2904217 r2972048 1 === AiWriter: A i Content Generation===1 === AiWriter: Automatic WordPress AI Writer, Copywriting Assistant & Content Repurposer / OpenAI GPT === 2 2 Contributors: floriansimeth 3 Tags: a i content creation, content generation, content automation, ai plugin, ai, gpt3, chat-gpt, gpt, gpt-34 Tested up to: 6. 25 Stable tag: 0. 9.03 Tags: automatic ai writer, copywriting assistant, content creation, content repurposer, content automation, ai plugin, ai, gpt3, chat-gpt, gpt, gpt-3 4 Tested up to: 6.3.1 5 Stable tag: 0.10.1 6 6 Requires PHP: 8.0 7 7 Requires at least: 6.2 … … 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Streamline your content creation with AI-powered writing: The Ultimate AiWriter WordPress Plugin for Bloggers and Writers.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 Hey there 👋, welcome to AiWriter -the ultimate AI-powered WordPress plugin for all the bloggers, writers and copywriters out there!16 Welcome 👋 to AiWriter, the ultimate AI-powered WordPress plugin for all the bloggers, writers and copywriters out there! 17 17 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.18 If you want to create engaging, high-quality content faster, AiWriter is the tool for you. Powered by AI technology, my plugin simplifies the content creation process so you can focus on the creative aspects. 19 19 20 === A iContent Generation ===20 === AI Content Generation === 21 21 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.22 AiWriter helps you create unique, SEO-optimised content quickly and efficiently. Just type '+++' and let the magic happen! Take advantage of the cutting-edge ChatGPT language model to produce unique, engaging and informative content. 23 23 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.24 Whether you're a blogger, writer or copywriter, AiWriter is an essential tool for streamlining your workflow, increasing efficiency and improving the quality of your work. The AI content creation capabilities allow you to create content that is uniquely crafted to reflect your style and meet your needs. 25 25 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!26 Why wait? Install AiWriter today and bring the power of AI to content writing in WordPress. Improve your content creation process and produce high quality, engaging content that your readers will enjoy. Once you experience AiWriter, you'll never want to go back to your old content creation methods! 27 27 28 === TheAI for Content Creation ===28 === AI for Content Creation === 29 29 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 andstyle.30 AiWriter is powered by Chat-GPT, an advanced AI language model that uses natural language processing to generate content. With our AI-powered content creation features, you can effortlessly create content that is unique, engaging, informative and reflects your style. 31 31 32 === Do your research right inWordPress ===32 === Conduct research directly from WordPress === 33 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.34 We have some exciting news! As of version 0.8.0, we've integrated Chat-GPT into AiWriter, greatly expanding its capabilities. Now you can conduct extensive research and write insightful, engaging content from within WordPress. 35 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.36 Harness the power of AI-powered natural language processing with Chat-GPT to gain valuable insights and ideas for your content. No matter what keywords you need or what specific topic you want to address, Chat-GPT has you covered. You can now access Chat-GPT directly from AiWriter, streamlining the process of creating high-quality content. 37 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.38 If you are looking for a tool to help you create informative, unique content, look no further than AiWriter. With our latest update, you can bring the power of Chat-GPT to your WordPress experience and take your content creation to new heights. 39 39 40 40 === Important note === -
aiwriter/trunk/aiwriter.php
r2904217 r2972048 2 2 /** 3 3 * Plugin Name: AiWriter 4 * Description: When the AI completes your sentence... Register at https://aiwriter.space to use this plugin! Thanks.4 * Description: Automatic WordPress AI Writer, Copywriting Assistant & Content Repurposer 5 5 * Requires at least: 6.2 6 6 * Requires PHP: 8.0.0 7 * Version: 0. 9.07 * Version: 0.10.1 8 8 * Author: floriansimeth 9 9 * License: GPL-2.0-or-later … … 23 23 use WP_REST_Response; 24 24 25 define( 'AIWRITER_API_URL', 'https://a iwriter.space/api/' );25 define( 'AIWRITER_API_URL', 'https://api.aiwriter.space/api/' ); 26 26 define( 'AIWRITER_STREAM_URL', 'https://stream.aiwriter.workers.dev' ); 27 27 … … 39 39 */ 40 40 function registerSettings(): void { 41 42 $cryptoHelper = static function ( $value ) { 43 static $cryptoValue = null; 44 45 # avoid double encryption 46 if ( is_string( $cryptoValue ) ) { 47 return $cryptoValue; 48 } 49 50 $cryptoValue = cryptoHelper( $value ); 51 52 return $cryptoValue; 53 }; 54 41 55 register_setting( 42 56 'options', … … 44 58 [ 45 59 'type' => 'string', 46 'sanitize_callback' => '\wpbuddy\ai_writer\cryptoHelper',60 'sanitize_callback' => $cryptoHelper, 47 61 'show_in_rest' => true, 48 62 'default' => '' … … 55 69 [ 56 70 'type' => 'string', 57 'sanitize_callback' => '\wpbuddy\ai_writer\cryptoHelper',71 'sanitize_callback' => $cryptoHelper, 58 72 'show_in_rest' => true, 59 73 'default' => '' … … 222 236 'ai-writer-no-license-information', 223 237 sprintf( 224 __( 'Hey %s, it looks like you haven\'t added your licence information yet. Enter the licence key in the settings (on the right side) and you\'re good to go.', 'aiwriter' ),238 __( 'Hey %s, it looks like you haven\'t added your licence information yet. Enter the licence key / purchase code in the settings (on the right side) and you\'re good to go.', 'aiwriter' ), 225 239 getCurrentUserFirstname() 226 240 ), … … 257 271 ); 258 272 } 273 } else { 274 $openAiSecretKey = ''; 259 275 } 260 276 … … 351 367 'ai-writer-no-license-information', 352 368 sprintf( 353 __( 'Hey %s, it looks like you haven\'t added your licence information yet. Enter the licence key in the settings (on the right side) and you\'re good to go.', 'aiwriter' ),369 __( 'Hey %s, it looks like you haven\'t added your licence information yet. Enter the licence key / purchase code in the settings (on the right side) and you\'re good to go.', 'aiwriter' ), 354 370 getCurrentUserFirstname() 355 371 ), … … 376 392 377 393 $body = [ 378 'model' => " text-davinci-003",394 'model' => "gpt-3.5-turbo-instruct", 379 395 'prompt' => $request->get_param( 'prompt' ), 380 396 'temperature' => (float) $request->get_param( 'temperature' ), -
aiwriter/trunk/build/blockEditor.asset.php
r2904217 r2972048 1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices', 'wp-plugins'), 'version' => ' 2ebe319528d7be03c835');1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices', 'wp-plugins'), 'version' => '10fc2ff2475dd6102c0e'); -
aiwriter/trunk/build/blockEditor.js
r2904217 r2972048 1 !function(){var e={705:function(e,t,r){var i=r(639).Symbol;e.exports=i},239:function(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:function(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:function(e,t,r){var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=i},607:function(e,t,r){var i=r(705),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,c=i?i.toStringTag:void 0;e.exports=function(e){var t=a.call(e,c),r=e[c];try{e[c]=void 0;var i=!0}catch(e){}var n=o.call(e);return i&&(t?e[c]=r:delete e[c]),n}},333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},639:function(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:function(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},279:function(e,t,r){var i=r(218),n=r(771),a=r(841),o=Math.max,c=Math.min;e.exports=function(e,t,r){var l,s,u,p,d,w,m=0,f=!1,v=!1,_=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var r=l,i=s;return l=s=void 0,m=t,p=e.apply(i,r)}function C(e){var r=e-w;return void 0===w||r>=t||r<0||v&&e-m>=u}function h(){var e=n();if(C(e))return E(e);d=setTimeout(h,function(e){var r=t-(e-w);return v?c(r,u-(e-m)):r}(e))}function E(e){return d=void 0,_&&l?g(e):(l=s=void 0,p)}function y(){var e=n(),r=C(e);if(l=arguments,s=this,w=e,r){if(void 0===d)return function(e){return m=e,d=setTimeout(h,t),f?g(e):p}(w);if(v)return clearTimeout(d),d=setTimeout(h,t),g(w)}return void 0===d&&(d=setTimeout(h,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:_),y.cancel=function(){void 0!==d&&clearTimeout(d),m=0,l=w=s=d=void 0},y.flush=function(){return void 0===d?p:E(n())},y}},218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},448:function(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:function(e,t,r){var i=r(639);e.exports=function(){return i.Date.now()}},841:function(e,t,r){var i=r(561),n=r(218),a=r(448),o=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^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=c.test(e);return r||l.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=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";window.React;var e=window.wp.plugins,t=window.wp.element,i=window.wp.i18n,n=window.wp.editPost,a=window.wp.components;const 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 c=r(279),l=r.n(c),s=window.wp.apiFetch,u=r.n(s),p=window.wp.data,d=window.wp.notices;const w=()=>{let{AiWriter:e}=window;const[r,n]=(0,t.useState)(!1),[o,c]=(0,t.useState)(e.isActive),[s,w]=(0,t.useState)(e.temperature),[m,f]=(0,t.useState)(e.textLength),v=l()(g,2e3),{createErrorNotice:_}=(0,p.useDispatch)(d.store);function g(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),_(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:()=>{c((e=>!e)),e.isActive=!o,g("isActive",e.isActive)}})," ",(0,i.__)("Activate AiWriter","aiwriter")),(0,t.createElement)(a.RangeControl,{label:(0,i.__)("Creativity","aiwriter"),value:s,onChange:e=>{w(e),v("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=>{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}))},m=()=>{const[e,r]=(0,t.useState)(!1),[n,o]=(0,t.useState)([]),{AiWriter:c}=window,{suggestTitles:l}=c;return(0,t.createElement)(a.PanelBody,{title:(0,i.__)("Title Suggestions","aiwriter"),initialOpen:!1,onToggle:async()=>{if(e)return;if(n.length>0)return;r(!0);let t=await l();o([...t]),r(!1)}},e&&(0,t.createElement)(a.Spinner,null),(0,t.createElement)("ul",null,n.map(((e,r)=>(0,t.createElement)("li",{key:r},(0,t.createElement)(a.Button,{onClick:()=>{(0,p.dispatch)("core/editor").editPost({title:e})},variant:"link"},e))))))},f=()=>{let{AiWriter:e}=window;const{events:r}=e,[n,o]=(0,t.useState)(!1),[c,s]=(0,t.useState)(e.isBlockAiActive),[f,v]=(0,t.useState)(""),[_,g]=(0,t.useState)(""),{createErrorNotice:C}=(0,p.useDispatch)(d.store),h=l()((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),E=l()((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)(m,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.__)("Block Ai","aiwriter"),initialOpen:!1},(0,t.createElement)("p",null,(0,t.createElement)(a.FormToggle,{checked:c,onChange:t=>{s(t.target.checked),e.isBlockAiActive=t.target.checked,((t,r)=>{let i={};i["aiwriter_"+t]=r,o(!0),u()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{e[t]=r,o(!1)})).catch((t=>{e.debug&&console.error(t),o(!1),C(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1})}))})("isBlockAiActive",t.target.checked)}})," ",(0,i.__)("Activate BlockAi (Experimental)","aiwriter"))),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("Your subscription","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==f)return;o(!0);const{editorType:t}=window.AiWriter;u()({path:"/wp/v2/settings?option_name=aiwriter%2Factivation_code",method:"GET"}).then((e=>{v(""!==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"===f?(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:()=>v("")},(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){v(e),h(e)},value:"ENCRYPTED"===f?"":f,placeholder:n?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===f?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("Activation code","aiwriter"),key:"activation-code"}),""!==f||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(""!==_)return;const{editorType:t}=window.AiWriter;o(!0),u()({path:"/wp/v2/settings?option_name=aiwriter%2Fopenai_secret_key",method:"GET"}).then((e=>{g(""!==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"===_?(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:()=>g("")},(0,i.__)("Edit","aiwriter")))):(0,t.createElement)(a.TextControl,{onChange:function(e){g(e),E(e)},value:"ENCRYPTED"===_?"":_,placeholder:n?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===_?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("OpenAi API Key","aiwriter"),key:"activation-code"}),""!==_||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"))))))};window.wp.blocks,window.wp.hooks,window.wp.compose,window.wp.blockEditor;const v=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)(f,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 !function(){var e={705:function(e,t,r){var i=r(639).Symbol;e.exports=i},239:function(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:function(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:function(e,t,r){var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=i},607:function(e,t,r){var i=r(705),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,c=i?i.toStringTag:void 0;e.exports=function(e){var t=a.call(e,c),r=e[c];try{e[c]=void 0;var i=!0}catch(e){}var n=o.call(e);return i&&(t?e[c]=r:delete e[c]),n}},333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},639:function(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:function(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},279:function(e,t,r){var i=r(218),n=r(771),a=r(841),o=Math.max,c=Math.min;e.exports=function(e,t,r){var l,s,u,p,d,w,m=0,f=!1,v=!1,_=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var r=l,i=s;return l=s=void 0,m=t,p=e.apply(i,r)}function g(e){var r=e-w;return void 0===w||r>=t||r<0||v&&e-m>=u}function C(){var e=n();if(g(e))return E(e);d=setTimeout(C,function(e){var r=t-(e-w);return v?c(r,u-(e-m)):r}(e))}function E(e){return d=void 0,_&&l?h(e):(l=s=void 0,p)}function y(){var e=n(),r=g(e);if(l=arguments,s=this,w=e,r){if(void 0===d)return function(e){return m=e,d=setTimeout(C,t),f?h(e):p}(w);if(v)return clearTimeout(d),d=setTimeout(C,t),h(w)}return void 0===d&&(d=setTimeout(C,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:_),y.cancel=function(){void 0!==d&&clearTimeout(d),m=0,l=w=s=d=void 0},y.flush=function(){return void 0===d?p:E(n())},y}},218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},448:function(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:function(e,t,r){var i=r(639);e.exports=function(){return i.Date.now()}},841:function(e,t,r){var i=r(561),n=r(218),a=r(448),o=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^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=c.test(e);return r||l.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=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";window.React;var e=window.wp.plugins,t=window.wp.element,i=window.wp.i18n,n=window.wp.editPost,a=window.wp.components;const 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 c=r(279),l=r.n(c),s=window.wp.apiFetch,u=r.n(s),p=window.wp.data,d=window.wp.notices;const w=()=>{let{AiWriter:e}=window;const[r,n]=(0,t.useState)(!1),[o,c]=(0,t.useState)(e.isActive),[s,w]=(0,t.useState)(e.temperature),[m,f]=(0,t.useState)(e.textLength),v=l()(h,2e3),{createErrorNotice:_}=(0,p.useDispatch)(d.store);function h(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),_(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:()=>{c((e=>!e)),e.isActive=!o,h("isActive",e.isActive)}})," ",(0,i.__)("Activate AiWriter","aiwriter")),(0,t.createElement)(a.RangeControl,{label:(0,i.__)("Creativity","aiwriter"),value:s,onChange:e=>{w(e),v("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=>{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}))},m=()=>{const[e,r]=(0,t.useState)(!1),[n,o]=(0,t.useState)([]),{AiWriter:c}=window,{suggestTitles:l}=c;return(0,t.createElement)(a.PanelBody,{title:(0,i.__)("Title Suggestions","aiwriter"),initialOpen:!1,onToggle:async()=>{if(e)return;if(n.length>0)return;r(!0);let t=await l();o([...t]),r(!1)}},e&&(0,t.createElement)(a.Spinner,null),(0,t.createElement)("ul",null,n.map(((e,r)=>(0,t.createElement)("li",{key:r},(0,t.createElement)(a.Button,{onClick:()=>{(0,p.dispatch)("core/editor").editPost({title:e})},variant:"link"},e))))))},f=()=>{let{AiWriter:e}=window;const{events:r}=e,[n,o]=(0,t.useState)(!1),[c,s]=(0,t.useState)(e.isBlockAiActive),[f,v]=(0,t.useState)(""),[_,h]=(0,t.useState)(""),{createErrorNotice:g}=(0,p.useDispatch)(d.store),C=l()((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),g(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===r?"aiWriter":"global"})}))}),1e3),E=l()((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":t}}).then((e=>{o(!1)})).catch((t=>{e.debug&&console.error(t),o(!1),g(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)(m,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.__)("Block Ai","aiwriter"),initialOpen:!1},(0,t.createElement)("p",null,(0,t.createElement)(a.FormToggle,{checked:c,onChange:t=>{s(t.target.checked),e.isBlockAiActive=t.target.checked,((t,r)=>{let i={};i["aiwriter_"+t]=r,o(!0),u()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{e[t]=r,o(!1)})).catch((t=>{e.debug&&console.error(t),o(!1),g(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1})}))})("isBlockAiActive",t.target.checked)}})," ",(0,i.__)("Activate BlockAi (Experimental)","aiwriter"))),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("Your license","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==f)return;o(!0);const{editorType:t}=window.AiWriter;u()({path:"/wp/v2/settings?option_name=aiwriter%2Factivation_code",method:"GET"}).then((e=>{v(""!==e["aiwriter/activation_code"]?"ENCRYPTED":""),o(!1)})).catch((r=>{e.debug&&console.error(r),o(!1),g(sprintf("Error: %s (%s)",r.message,r.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===t?"aiWriter":"global"})}))}},"ENCRYPTED"===f?(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:()=>v("")},(0,i.__)("Edit","aiwriter")))):(0,t.createElement)(a.TextControl,{onChange:function(e){v(e),C(e)},value:"ENCRYPTED"===f?"":f,placeholder:n?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===f?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("Activation code","aiwriter"),key:"activation-code"}),""!==f||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)("p",null,(0,t.createElement)("a",{href:"https://wp-buddy.com/blog/where-to-find-your-envato-purchase-code/",target:"_blank"},(0,i.__)("Where to find your Envato purchase code","aiwriter")))),(0,t.createElement)(a.PanelBody,{title:(0,i.__)("OpenAi","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==_)return;const{editorType:t}=window.AiWriter;o(!0),u()({path:"/wp/v2/settings?option_name=aiwriter%2Fopenai_secret_key",method:"GET"}).then((e=>{h(""!==e["aiwriter/openai_secret_key"]?"ENCRYPTED":""),o(!1)})).catch((r=>{e.debug&&console.error(r),o(!1),g(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"===_?(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:()=>h("")},(0,i.__)("Edit","aiwriter")))):(0,t.createElement)(a.TextControl,{onChange:function(e){h(e),E(e)},value:"ENCRYPTED"===_?"":_,placeholder:n?(0,i.__)("Loading code ...","aiwriter"):"ENCRYPTED"===_?(0,i.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,i.__)("OpenAi API Key","aiwriter"),key:"activation-code"}),""!==_||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"))))))};window.wp.blocks,window.wp.hooks,window.wp.compose,window.wp.blockEditor;const v=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)(f,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/chatWindow.asset.php
r2904217 r2972048 1 <?php return array('dependencies' => array('react', 'wp-dom-ready'), 'version' => ' e9ae515b91c3fd8fcd9d');1 <?php return array('dependencies' => array('react', 'wp-dom-ready'), 'version' => '6ffef729b427738e3fd2'); -
aiwriter/trunk/build/chatWindow.css
r2904217 r2972048 1 .aiwriter-chatwindow{background-color:#fff;box-shadow:0 0 10px rgba(0,0,0,.498);display:flex;flex-direction:column;height:calc(100vh - 4rem);justify-content:space-between;max-width:80%;min-width:900px;outline:3px solid #480693;padding:2rem;position:absolute;right:0;top:0;width:50%}@media(max-width:900px){.aiwriter-chatwindow{min-width:calc(100vw - 4rem);z-index:9999}}.aiwriter-chatwindow h1{flex:1 0 auto;padding:0 1rem}.aiwriter-chatwindow.hidden{display:none}.aiwriter-chatwindow .aiwriter-chatwindow__footer,.aiwriter-chatwindow .aiwriter-chatwindow__header{display:flex;gap:.5rem;justify-content:space-between}.aiwriter-chatwindow .aiwriter-chatwindow__footer{align-items:flex-end}.aiwriter-chatwindow .aiwriter-chatwindow__footer .aiwriter-chatwindow__footer__prompt{flex:1 1 auto;margin-bottom:0}.aiwriter-chatwindow .aiwriter-chatwindow__footer button{margin-bottom:.7rem}.aiwriter-chatwindow .aiwriter-chatwindow__body{height:100%;overflow-x:auto}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message{border-left:2px solid transparent;display:flex;flex-direction:row;font-size:.9rem;justify-content:space-between;line-height:1.3rem;padding:1rem}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message pre{background-color:#000;color:#fff}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message table,.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message table td,.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message table th{border:1px solid #000;padding:.5em}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message table{border-collapse:collapse;margin:.5em 0}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message p{font-size:1rem;margin:0}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message div{flex:0 1 auto;margin-left:1rem }.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message.referred{border-left:2px solid #480693}.aiwriter-chatwindow .aiwriter-chatwindow__body>.aiwriter-chatwindow__body__message:nth-child(2n){border-bottom:1px solid rgba(0,0,0,.098);border-top:1px solid rgba(0,0,0,.098)}.aiwriter-chatwindow .aiwriter-chatwindow__body>.aiwriter-chatwindow__body__message.assistant{background-color:#f7f7f8}.aiwriter-chatwindow .aiwriter-chatwindow__body .ai-loader{display:block;margin:1rem}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body_stop{display:flex}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body_stop button{align-self:center}1 .aiwriter-chatwindow{background-color:#fff;box-shadow:0 0 10px rgba(0,0,0,.498);display:flex;flex-direction:column;height:calc(100vh - 4rem);justify-content:space-between;max-width:80%;min-width:900px;outline:3px solid #480693;padding:2rem;position:absolute;right:0;top:0;width:50%}@media(max-width:900px){.aiwriter-chatwindow{min-width:calc(100vw - 4rem);z-index:9999}}.aiwriter-chatwindow h1{flex:1 0 auto;padding:0 1rem}.aiwriter-chatwindow.hidden{display:none}.aiwriter-chatwindow .aiwriter-chatwindow__footer,.aiwriter-chatwindow .aiwriter-chatwindow__header{display:flex;gap:.5rem;justify-content:space-between}.aiwriter-chatwindow .aiwriter-chatwindow__footer{align-items:flex-end}.aiwriter-chatwindow .aiwriter-chatwindow__footer .aiwriter-chatwindow__footer__prompt{flex:1 1 auto;margin-bottom:0}.aiwriter-chatwindow .aiwriter-chatwindow__footer button{margin-bottom:.7rem}.aiwriter-chatwindow .aiwriter-chatwindow__body{height:100%;overflow-x:auto}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message{border-left:2px solid transparent;display:flex;flex-direction:row;font-size:.9rem;justify-content:space-between;line-height:1.3rem;padding:1rem}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message pre{background-color:#000;color:#fff}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message table,.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message table td,.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message table th{border:1px solid #000;padding:.5em}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message table{border-collapse:collapse;margin:.5em 0}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message p{font-size:1rem;margin:0}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message div{flex:0 1 auto;margin-left:1rem;white-space:pre-line}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body__message.referred{border-left:2px solid #480693}.aiwriter-chatwindow .aiwriter-chatwindow__body>.aiwriter-chatwindow__body__message:nth-child(2n){border-bottom:1px solid rgba(0,0,0,.098);border-top:1px solid rgba(0,0,0,.098)}.aiwriter-chatwindow .aiwriter-chatwindow__body>.aiwriter-chatwindow__body__message.assistant{background-color:#f7f7f8}.aiwriter-chatwindow .aiwriter-chatwindow__body .ai-loader{display:block;margin:1rem}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body_stop{display:flex}.aiwriter-chatwindow .aiwriter-chatwindow__body .aiwriter-chatwindow__body_stop button{align-self:center} -
aiwriter/trunk/build/classicEditor.asset.php
r2904217 r2972048 1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices'), 'version' => ' ececf369cc9ab3b7ffd7');1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices'), 'version' => 'cc0470255dcba7ccc6d9'); -
aiwriter/trunk/build/classicEditor.js
r2904217 r2972048 1 !function(){var e={705:function(e,t,r){var i=r(639).Symbol;e.exports=i},239:function(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:function(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:function(e,t,r){var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=i},607:function(e,t,r){var i=r(705),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,c=i?i.toStringTag:void 0;e.exports=function(e){var t=a.call(e,c),r=e[c];try{e[c]=void 0;var i=!0}catch(e){}var n=o.call(e);return i&&(t?e[c]=r:delete e[c]),n}},333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},639:function(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:function(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},279:function(e,t,r){var i=r(218),n=r(771),a=r(841),o=Math.max,c=Math.min;e.exports=function(e,t,r){var l,s,u,p, m,d,f=0,w=!1,_=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var r=l,i=s;return l=s=void 0,f=t,p=e.apply(i,r)}function h(e){var r=e-d;return void 0===d||r>=t||r<0||_&&e-f>=u}function E(){var e=n();if(h(e))return y(e);m=setTimeout(E,function(e){var r=t-(e-d);return _?c(r,u-(e-f)):r}(e))}function y(e){return m=void 0,v&&l?g(e):(l=s=void 0,p)}function b(){var e=n(),r=h(e);if(l=arguments,s=this,d=e,r){if(void 0===m)return function(e){return f=e,m=setTimeout(E,t),w?g(e):p}(d);if(_)return clearTimeout(m),m=setTimeout(E,t),g(d)}return void 0===m&&(m=setTimeout(E,t)),p}return t=a(t)||0,i(r)&&(w=!!r.leading,u=(_="maxWait"in r)?o(a(r.maxWait)||0,t):u,v="trailing"in r?!!r.trailing:v),b.cancel=function(){void 0!==m&&clearTimeout(m),f=0,l=d=s=m=void 0},b.flush=function(){return void 0===m?p:y(n())},b}},218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},448:function(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:function(e,t,r){var i=r(639);e.exports=function(){return i.Date.now()}},841:function(e,t,r){var i=r(561),n=r(218),a=r(448),o=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^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=c.test(e);return r||l.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=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=window.wp.element,t=(window.React,window.wp.i18n),i=window.wp.components,n=r(279),a=r.n(n),o=window.wp.apiFetch,c=r.n(o),l=window.wp.data,s=window.wp.notices;const u=()=>{let{AiWriter:r}=window;const[n,o]=(0,e.useState)(!1),[u,p]=(0,e.useState)(r.isActive),[m,d]=(0,e.useState)(r.temperature),[f,w]=(0,e.useState)(r.textLength),_=a()(g,2e3),{createErrorNotice:v}=(0,l.useDispatch)(s.store);function g(e,t){let i={};i["aiwriter_"+e]=t,o(!0),c()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{r[e]=t,o(!1)})).catch((e=>{r.debug&&console.error(e),o(!1),v(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1})}))}return(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Text generation settings","aiwriter")},(0,e.createElement)("p",null,(0,e.createElement)(i.FormToggle,{checked:u,onChange:()=>{p((e=>!e)),r.isActive=!u,g("isActive",r.isActive)}})," ",(0,t.__)("Activate AiWriter","aiwriter")),(0,e.createElement)(i.RangeControl,{label:(0,t.__)("Creativity","aiwriter"),value:m,onChange:e=>{d(e),_("temperature",e)},min:0,max:2,step:.1,withInputField:!1,renderTooltipContent:e=>e<=0?(0,t.__)("Not creative at all","aiwriter"):e>=.8?(0,t.__)("Very creative","aiwriter"):e>=.5?(0,t.__)("Reasonably creative","aiwriter"):e<.5?(0,t.__)("Rather less creative","aiwriter"):void 0}),(0,e.createElement)(i.RangeControl,{label:(0,t.__)("Max. text length","aiwriter"),value:f,onChange:e=>{w(e),_("textLength",e)},min:200,max:1e3,showTooltip:!1,marks:[{value:200,label:(0,t.__)("Little","aiwriter")},{value:400,label:(0,t.__)("Medium","aiwriter")},{value:600,label:(0,t.__)("Long","aiwriter")},{value:800,label:(0,t.__)("Very long","aiwriter")},{value:1e3,label:(0,t.__)("Maximum","aiwriter")}],step:200,withInputField:!1}))},p=()=>{const[r,n]=(0,e.useState)(!1),[a,o]=(0,e.useState)([]),{AiWriter:c}=window,{suggestTitles:s}=c;return(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Title Suggestions","aiwriter"),initialOpen:!1,onToggle:async()=>{if(r)return;if(a.length>0)return;n(!0);let e=await s();o([...e]),n(!1)}},r&&(0,e.createElement)(i.Spinner,null),(0,e.createElement)("ul",null,a.map(((t,r)=>(0,e.createElement)("li",{key:r},(0,e.createElement)(i.Button,{onClick:()=>{(0,l.dispatch)("core/editor").editPost({title:t})},variant:"link"},t))))))},m=()=>{let{AiWriter:r}=window;const{events:n}=r,[o,m]=(0,e.useState)(!1),[d,f]=(0,e.useState)(r.isBlockAiActive),[w,_]=(0,e.useState)(""),[v,g]=(0,e.useState)(""),{createErrorNotice:h}=(0,l.useDispatch)(s.store),E=a()((function(e){if(""===e)return;const{editorType:t}=window.AiWriter;m(!0),c()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/activation_code","aiwriter/activation_code":e}}).then((e=>{m(!1)})).catch((e=>{r.debug&&console.error(e),m(!1),h(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===t?"aiWriter":"global"})}))}),1e3),y=a()((function(e){if(""===e)return;const{editorType:t}=window.AiWriter;m(!0),c()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/openai_secret_key","aiwriter/openai_secret_key":code}}).then((e=>{m(!1)})).catch((e=>{r.debug&&console.error(e),m(!1),h(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===t?"aiWriter":"global"})}))}),1e3);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(p,null),(0,e.createElement)(u,null),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Ai Chat","aiwriter"),initialOpen:!0},(0,e.createElement)(i.Button,{icon:"format-chat",variant:"primary",onClick:()=>{n.dispatch("aiWriter.chatOpen",!0)}},(0,t.__)("Start Ai Chat","aiwriter"))),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Block Ai","aiwriter"),initialOpen:!1},(0,e.createElement)("p",null,(0,e.createElement)(i.FormToggle,{checked:d,onChange:e=>{f(e.target.checked),r.isBlockAiActive=e.target.checked,((e,t)=>{let i={};i["aiwriter_"+e]=t,m(!0),c()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{r[e]=t,m(!1)})).catch((e=>{r.debug&&console.error(e),m(!1),h(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1})}))})("isBlockAiActive",e.target.checked)}})," ",(0,t.__)("Activate BlockAi (Experimental)","aiwriter"))),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Your subscription","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==w)return;m(!0);const{editorType:e}=window.AiWriter;c()({path:"/wp/v2/settings?option_name=aiwriter%2Factivation_code",method:"GET"}).then((e=>{_(""!==e["aiwriter/activation_code"]?"ENCRYPTED":""),m(!1)})).catch((t=>{r.debug&&console.error(t),m(!1),h(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===e?"aiWriter":"global"})}))}},"ENCRYPTED"===w?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,t.__)("Activation code already entered.","aiwriter")," ",(0,e.createElement)(i.Button,{variant:"link",onClick:()=>_("")},(0,t.__)("Edit","aiwriter"))),(0,e.createElement)("p",null,(0,e.createElement)("a",{href:"https://billing.aiwriter.space/p/login/aEU4jGfC87qg7NSaEE",target:"_blank"},(0,t.__)("Manage your subscription","aiwriter")))):(0,e.createElement)(i.TextControl,{onChange:function(e){_(e),E(e)},value:"ENCRYPTED"===w?"":w,placeholder:o?(0,t.__)("Loading code ...","aiwriter"):"ENCRYPTED"===w?(0,t.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,t.__)("Activation code","aiwriter"),key:"activation-code"}),""!==w||o?null:(0,e.createElement)("p",{key:"buy-now"},(0,e.createElement)("a",{href:"https://aiwriter.space",target:"_blank"},(0,t.__)("Don't have an activation code yet? Click here.","aiwriter"))),o?(0,e.createElement)(i.Spinner,null):null),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("OpenAi","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==v)return;const{editorType:e}=window.AiWriter;m(!0),c()({path:"/wp/v2/settings?option_name=aiwriter%2Fopenai_secret_key",method:"GET"}).then((e=>{g(""!==e["aiwriter/openai_secret_key"]?"ENCRYPTED":""),m(!1)})).catch((t=>{r.debug&&console.error(t),m(!1),h(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===e?"aiWriter":"global"})}))}},(0,e.createElement)("p",{key:"openai-api-descriptions"},(0,t.__)("After the free trial period, you will need a secret key from OpenAI for this plugin to work properly.","aiwriter")),"ENCRYPTED"===v?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,t.__)("OpenAI secret key already entered.","aiwriter")," ",(0,e.createElement)(i.Button,{variant:"link",onClick:()=>g("")},(0,t.__)("Edit","aiwriter")))):(0,e.createElement)(i.TextControl,{onChange:function(e){g(e),y(e)},value:"ENCRYPTED"===v?"":v,placeholder:o?(0,t.__)("Loading code ...","aiwriter"):"ENCRYPTED"===v?(0,t.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,t.__)("OpenAi API Key","aiwriter"),key:"activation-code"}),""!==v||o?null:(0,e.createElement)("p",{key:"openai-api-keys"},(0,e.createElement)("a",{href:"https://platform.openai.com/account/api-keys",target:"_blank"},(0,t.__)("Don't have a secret key yet? Click here.","aiwriter"))),o?(0,e.createElement)(i.Spinner,null):null),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("FAQ & Features","aiwriter"),initialOpen:!1},(0,e.createElement)("ul",null,(0,e.createElement)("li",null,(0,e.createElement)(i.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriter.space/faq.html"},(0,t.__)("Frequently asked questions","aiwriter"))),(0,e.createElement)("li",null,(0,e.createElement)(i.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriterwp.canny.io/feature-requests"},(0,t.__)("Feature requests","aiwriter"))))))},d=()=>{const{removeNotice:t}=(0,l.useDispatch)(s.store);let r=(0,l.useSelect)((e=>e(s.store).getNotices("aiWriter"))),n=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)(i.NoticeList,{notices:r,onRemove:e=>t(e,"aiWriter"),className:"components-editor-notices__dismissible"}),(0,e.createElement)(i.SnackbarList,{notices:n,className:"components-editor-notices__snackbar",onRemove:t}))};if(e.createRoot){const t=document.getElementById("aiWriterSettings");t&&(0,e.createRoot)(t).render((0,e.createElement)(m,null));const r=document.getElementById("aiWriterNotices");r&&(0,e.createRoot)(r).render((0,e.createElement)(d,null))}}()}();1 !function(){var e={705:function(e,t,r){var i=r(639).Symbol;e.exports=i},239:function(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:function(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:function(e,t,r){var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=i},607:function(e,t,r){var i=r(705),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,c=i?i.toStringTag:void 0;e.exports=function(e){var t=a.call(e,c),r=e[c];try{e[c]=void 0;var i=!0}catch(e){}var n=o.call(e);return i&&(t?e[c]=r:delete e[c]),n}},333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},639:function(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:function(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},279:function(e,t,r){var i=r(218),n=r(771),a=r(841),o=Math.max,c=Math.min;e.exports=function(e,t,r){var l,s,u,p,d,m,f=0,w=!1,_=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var r=l,i=s;return l=s=void 0,f=t,p=e.apply(i,r)}function g(e){var r=e-m;return void 0===m||r>=t||r<0||_&&e-f>=u}function y(){var e=n();if(g(e))return E(e);d=setTimeout(y,function(e){var r=t-(e-m);return _?c(r,u-(e-f)):r}(e))}function E(e){return d=void 0,v&&l?h(e):(l=s=void 0,p)}function b(){var e=n(),r=g(e);if(l=arguments,s=this,m=e,r){if(void 0===d)return function(e){return f=e,d=setTimeout(y,t),w?h(e):p}(m);if(_)return clearTimeout(d),d=setTimeout(y,t),h(m)}return void 0===d&&(d=setTimeout(y,t)),p}return t=a(t)||0,i(r)&&(w=!!r.leading,u=(_="maxWait"in r)?o(a(r.maxWait)||0,t):u,v="trailing"in r?!!r.trailing:v),b.cancel=function(){void 0!==d&&clearTimeout(d),f=0,l=m=s=d=void 0},b.flush=function(){return void 0===d?p:E(n())},b}},218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},448:function(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:function(e,t,r){var i=r(639);e.exports=function(){return i.Date.now()}},841:function(e,t,r){var i=r(561),n=r(218),a=r(448),o=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^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=c.test(e);return r||l.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=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=window.wp.element,t=(window.React,window.wp.i18n),i=window.wp.components,n=r(279),a=r.n(n),o=window.wp.apiFetch,c=r.n(o),l=window.wp.data,s=window.wp.notices;const u=()=>{let{AiWriter:r}=window;const[n,o]=(0,e.useState)(!1),[u,p]=(0,e.useState)(r.isActive),[d,m]=(0,e.useState)(r.temperature),[f,w]=(0,e.useState)(r.textLength),_=a()(h,2e3),{createErrorNotice:v}=(0,l.useDispatch)(s.store);function h(e,t){let i={};i["aiwriter_"+e]=t,o(!0),c()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{r[e]=t,o(!1)})).catch((e=>{r.debug&&console.error(e),o(!1),v(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1})}))}return(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Text generation settings","aiwriter")},(0,e.createElement)("p",null,(0,e.createElement)(i.FormToggle,{checked:u,onChange:()=>{p((e=>!e)),r.isActive=!u,h("isActive",r.isActive)}})," ",(0,t.__)("Activate AiWriter","aiwriter")),(0,e.createElement)(i.RangeControl,{label:(0,t.__)("Creativity","aiwriter"),value:d,onChange:e=>{m(e),_("temperature",e)},min:0,max:2,step:.1,withInputField:!1,renderTooltipContent:e=>e<=0?(0,t.__)("Not creative at all","aiwriter"):e>=.8?(0,t.__)("Very creative","aiwriter"):e>=.5?(0,t.__)("Reasonably creative","aiwriter"):e<.5?(0,t.__)("Rather less creative","aiwriter"):void 0}),(0,e.createElement)(i.RangeControl,{label:(0,t.__)("Max. text length","aiwriter"),value:f,onChange:e=>{w(e),_("textLength",e)},min:200,max:1e3,showTooltip:!1,marks:[{value:200,label:(0,t.__)("Little","aiwriter")},{value:400,label:(0,t.__)("Medium","aiwriter")},{value:600,label:(0,t.__)("Long","aiwriter")},{value:800,label:(0,t.__)("Very long","aiwriter")},{value:1e3,label:(0,t.__)("Maximum","aiwriter")}],step:200,withInputField:!1}))},p=()=>{const[r,n]=(0,e.useState)(!1),[a,o]=(0,e.useState)([]),{AiWriter:c}=window,{suggestTitles:s}=c;return(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Title Suggestions","aiwriter"),initialOpen:!1,onToggle:async()=>{if(r)return;if(a.length>0)return;n(!0);let e=await s();o([...e]),n(!1)}},r&&(0,e.createElement)(i.Spinner,null),(0,e.createElement)("ul",null,a.map(((t,r)=>(0,e.createElement)("li",{key:r},(0,e.createElement)(i.Button,{onClick:()=>{(0,l.dispatch)("core/editor").editPost({title:t})},variant:"link"},t))))))},d=()=>{let{AiWriter:r}=window;const{events:n}=r,[o,d]=(0,e.useState)(!1),[m,f]=(0,e.useState)(r.isBlockAiActive),[w,_]=(0,e.useState)(""),[v,h]=(0,e.useState)(""),{createErrorNotice:g}=(0,l.useDispatch)(s.store),y=a()((function(e){if(""===e)return;const{editorType:t}=window.AiWriter;d(!0),c()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/activation_code","aiwriter/activation_code":e}}).then((e=>{d(!1)})).catch((e=>{r.debug&&console.error(e),d(!1),g(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===t?"aiWriter":"global"})}))}),1e3),E=a()((function(e){if(""===e)return;const{editorType:t}=window.AiWriter;d(!0),c()({path:"/wp/v2/settings/",method:"POST",data:{option_name:"aiwriter/openai_secret_key","aiwriter/openai_secret_key":e}}).then((e=>{d(!1)})).catch((e=>{r.debug&&console.error(e),d(!1),g(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===t?"aiWriter":"global"})}))}),1e3);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(p,null),(0,e.createElement)(u,null),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Ai Chat","aiwriter"),initialOpen:!0},(0,e.createElement)(i.Button,{icon:"format-chat",variant:"primary",onClick:()=>{n.dispatch("aiWriter.chatOpen",!0)}},(0,t.__)("Start Ai Chat","aiwriter"))),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Block Ai","aiwriter"),initialOpen:!1},(0,e.createElement)("p",null,(0,e.createElement)(i.FormToggle,{checked:m,onChange:e=>{f(e.target.checked),r.isBlockAiActive=e.target.checked,((e,t)=>{let i={};i["aiwriter_"+e]=t,d(!0),c()({path:"/wp/v2/users/me/",method:"POST",data:{meta:i}}).then((i=>{r[e]=t,d(!1)})).catch((e=>{r.debug&&console.error(e),d(!1),g(sprintf("Error: %s (%s)",e.message,e.code),{type:"snackbar",explicitDismiss:!1})}))})("isBlockAiActive",e.target.checked)}})," ",(0,t.__)("Activate BlockAi (Experimental)","aiwriter"))),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("Your license","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==w)return;d(!0);const{editorType:e}=window.AiWriter;c()({path:"/wp/v2/settings?option_name=aiwriter%2Factivation_code",method:"GET"}).then((e=>{_(""!==e["aiwriter/activation_code"]?"ENCRYPTED":""),d(!1)})).catch((t=>{r.debug&&console.error(t),d(!1),g(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===e?"aiWriter":"global"})}))}},"ENCRYPTED"===w?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,t.__)("Activation code already entered.","aiwriter")," ",(0,e.createElement)(i.Button,{variant:"link",onClick:()=>_("")},(0,t.__)("Edit","aiwriter")))):(0,e.createElement)(i.TextControl,{onChange:function(e){_(e),y(e)},value:"ENCRYPTED"===w?"":w,placeholder:o?(0,t.__)("Loading code ...","aiwriter"):"ENCRYPTED"===w?(0,t.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,t.__)("Activation code","aiwriter"),key:"activation-code"}),""!==w||o?null:(0,e.createElement)("p",{key:"buy-now"},(0,e.createElement)("a",{href:"https://aiwriter.space",target:"_blank"},(0,t.__)("Don't have an activation code yet? Click here.","aiwriter"))),o?(0,e.createElement)(i.Spinner,null):null,(0,e.createElement)("p",null,(0,e.createElement)("a",{href:"https://wp-buddy.com/blog/where-to-find-your-envato-purchase-code/",target:"_blank"},(0,t.__)("Where to find your Envato purchase code","aiwriter")))),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("OpenAi","aiwriter"),initialOpen:!1,onToggle:()=>{if(""!==v)return;const{editorType:e}=window.AiWriter;d(!0),c()({path:"/wp/v2/settings?option_name=aiwriter%2Fopenai_secret_key",method:"GET"}).then((e=>{h(""!==e["aiwriter/openai_secret_key"]?"ENCRYPTED":""),d(!1)})).catch((t=>{r.debug&&console.error(t),d(!1),g(sprintf("Error: %s (%s)",t.message,t.code),{type:"snackbar",explicitDismiss:!1,context:"classic"===e?"aiWriter":"global"})}))}},(0,e.createElement)("p",{key:"openai-api-descriptions"},(0,t.__)("After the free trial period, you will need a secret key from OpenAI for this plugin to work properly.","aiwriter")),"ENCRYPTED"===v?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,t.__)("OpenAI secret key already entered.","aiwriter")," ",(0,e.createElement)(i.Button,{variant:"link",onClick:()=>h("")},(0,t.__)("Edit","aiwriter")))):(0,e.createElement)(i.TextControl,{onChange:function(e){h(e),E(e)},value:"ENCRYPTED"===v?"":v,placeholder:o?(0,t.__)("Loading code ...","aiwriter"):"ENCRYPTED"===v?(0,t.__)("**encrypted**","aiwriter"):"abcdefghijklmnopqrstuvwxyz=",label:(0,t.__)("OpenAi API Key","aiwriter"),key:"activation-code"}),""!==v||o?null:(0,e.createElement)("p",{key:"openai-api-keys"},(0,e.createElement)("a",{href:"https://platform.openai.com/account/api-keys",target:"_blank"},(0,t.__)("Don't have a secret key yet? Click here.","aiwriter"))),o?(0,e.createElement)(i.Spinner,null):null),(0,e.createElement)(i.PanelBody,{title:(0,t.__)("FAQ & Features","aiwriter"),initialOpen:!1},(0,e.createElement)("ul",null,(0,e.createElement)("li",null,(0,e.createElement)(i.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriter.space/faq.html"},(0,t.__)("Frequently asked questions","aiwriter"))),(0,e.createElement)("li",null,(0,e.createElement)(i.Button,{variant:"link",icon:"external",iconSize:5,target:"_blank",href:"https://aiwriterwp.canny.io/feature-requests"},(0,t.__)("Feature requests","aiwriter"))))))},m=()=>{const{removeNotice:t}=(0,l.useDispatch)(s.store);let r=(0,l.useSelect)((e=>e(s.store).getNotices("aiWriter"))),n=r.filter((({type:e})=>"snackbar"===e));return r=r.filter((({isDismissible:e,type:t})=>"default"===t)),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(i.NoticeList,{notices:r,onRemove:e=>t(e,"aiWriter"),className:"components-editor-notices__dismissible"}),(0,e.createElement)(i.SnackbarList,{notices:n,className:"components-editor-notices__snackbar",onRemove:t}))};if(e.createRoot){const t=document.getElementById("aiWriterSettings");t&&(0,e.createRoot)(t).render((0,e.createElement)(d,null));const r=document.getElementById("aiWriterNotices");r&&(0,e.createRoot)(r).render((0,e.createElement)(m,null))}}()}(); -
aiwriter/trunk/languages/de_DE.po
r2880249 r2972048 2 2 msgstr "" 3 3 "Project-Id-Version: AiWriter\n" 4 "POT-Creation-Date: 2023-0 3-09 14:13+0100\n"5 "PO-Revision-Date: 2023-0 3-09 14:45+0100\n"4 "POT-Creation-Date: 2023-09-18 11:41+0200\n" 5 "PO-Revision-Date: 2023-09-18 11:41+0200\n" 6 6 "Last-Translator: \n" 7 7 "Language-Team: \n" … … 11 11 "Content-Transfer-Encoding: 8bit\n" 12 12 "Plural-Forms: nplurals=2; plural=(n != 1);\n" 13 "X-Generator: Poedit 3. 2.2\n"13 "X-Generator: Poedit 3.3.2\n" 14 14 "X-Poedit-Basepath: ..\n" 15 15 "X-Poedit-Flags-xgettext: --add-comments=translators:\n" … … 28 28 29 29 #: aiwriter.php:86 30 msgid "If Block Ai functionality is active for this user." 31 msgstr "Ob die Block-AI Funktionalität für diesen Benutzer aktiviert ist." 32 33 #: aiwriter.php:104 30 34 msgid "If the onboarding process has been completed." 31 35 msgstr "Ob der Onboarding-Prozess abgeschlossen ist." 32 36 33 #: aiwriter.php:1 0437 #: aiwriter.php:122 34 38 msgid "The temperature that was set by the user. Value from 0.0 to 1.0." 35 39 msgstr "" 36 40 "Die Temperatur, die vom Benutzer eingestellt wurde. Wert von 0,0 bis 1,0." 37 41 38 #: aiwriter.php:1 2242 #: aiwriter.php:140 39 43 msgid "The text length that was set by the user. Value from 200 to 1000." 40 44 msgstr "" 41 45 "Die Textlänge, die vom Benutzer eingestellt wurde. Wert von 200 bis 1000." 42 46 43 #: aiwriter.php:2 06 aiwriter.php:33547 #: aiwriter.php:224 aiwriter.php:353 44 48 #, php-format 45 49 msgid "" … … 51 55 "rechten Seite) ein und Du kannst loslegen." 52 56 53 #: aiwriter.php:2 13 aiwriter.php:34257 #: aiwriter.php:231 aiwriter.php:360 54 58 msgid "" 55 59 "If you don't have a license key, sign up for our newsletter and gain access " … … 64 68 "exklusiven Best-Practice-Informationen." 65 69 66 #: aiwriter.php:2 26 aiwriter.php:35570 #: aiwriter.php:244 aiwriter.php:373 67 71 #, php-format 68 72 msgid "Could not decrypt your activation code. Got error: %s" … … 70 74 "Ihr Aktivierungscode konnte nicht entschlüsselt werden. Fehler erhalten: %s" 71 75 72 #: aiwriter.php:2 3876 #: aiwriter.php:256 73 77 #, php-format 74 78 msgid "Could not decrypt your Open AI Secret Key code. Got error: %s" … … 77 81 "erhalten: %s" 78 82 79 #: aiwriter.php:2 8083 #: aiwriter.php:298 80 84 #, php-format 81 85 msgid "Could not fetch token from API (wrong status code) with error: %s (%d)" … … 84 88 "%s (%d)" 85 89 86 #: aiwriter.php: 29290 #: aiwriter.php:310 87 91 #, php-format 88 92 msgid "Could not fetch token from API. Got error: %s (%d)" … … 90 94 "Das Token konnte nicht von der API geholt werden. Fehler erhalten: %s (%d)" 91 95 92 #: aiwriter.php:3 0296 #: aiwriter.php:320 93 97 msgid "Could not fetch token from API (wrong status code)." 94 98 msgstr "" 95 99 "Das Token konnte nicht von der API geholt werden (falscher Statuscode)." 96 100 97 #: aiwriter.php:3 10101 #: aiwriter.php:328 98 102 msgid "Could not fetch token from API (no string)." 99 103 msgstr "Das Token konnte nicht von der API geholt werden (kein String)." 100 104 101 #: aiwriter.php:4 07105 #: aiwriter.php:425 102 106 #, php-format 103 107 msgid "Could not fetch data from API (wrong status code) with error: %s (%d)" … … 106 110 "Fehler: %s (%d)" 107 111 108 #: aiwriter.php:4 17112 #: aiwriter.php:435 109 113 msgid "Could not fetch data from API (wrong status code)." 110 114 msgstr "" 111 115 "Es konnten keine Daten von der API abgerufen werden (falscher Statuscode)." 112 116 113 #: aiwriter.php:6 70117 #: aiwriter.php:689 114 118 msgid "Cannot decrypt." 115 119 msgstr "Keine Entschlüsselung möglich." 116 120 117 #: aiwriter.php:8 05121 #: aiwriter.php:824 118 122 msgid "AiWriter Settings" 119 123 msgstr "AiWriter Einstellungen" … … 125 129 #. Description of the plugin/theme 126 130 msgid "" 127 "When the AI completes your sentence... Register at https://aiwriter.space to " 128 "use this plugin! Thanks." 131 "Automatic WordPress AI Writer, Copywriting Assistant & Content Repurposer" 129 132 msgstr "" 130 "Wenn die KI Deinen Satz vervollständigt… Registriere dich unter https://"131 "aiwriter.space, um dieses Plugin zu nutzen! Vielen Dank."132 133 133 134 #. Author of the plugin/theme 134 135 msgid "floriansimeth" 135 136 msgstr "" 137 138 #~ msgid "" 139 #~ "When the AI completes your sentence... Register at https://aiwriter.space " 140 #~ "to use this plugin! Thanks." 141 #~ msgstr "" 142 #~ "Wenn die KI Deinen Satz vervollständigt… Registriere dich unter https://" 143 #~ "aiwriter.space, um dieses Plugin zu nutzen! Vielen Dank." -
aiwriter/trunk/readme.txt
r2904217 r2972048 1 === AiWriter: A i Content Generation===1 === AiWriter: Automatic WordPress AI Writer, Copywriting Assistant & Content Repurposer / OpenAI GPT === 2 2 Contributors: floriansimeth 3 Tags: a i content creation, content generation, content automation, ai plugin, ai, gpt3, chat-gpt, gpt, gpt-34 Tested up to: 6. 25 Stable tag: 0. 9.03 Tags: automatic ai writer, copywriting assistant, content creation, content repurposer, content automation, ai plugin, ai, gpt3, chat-gpt, gpt, gpt-3 4 Tested up to: 6.3.1 5 Stable tag: 0.10.1 6 6 Requires PHP: 8.0 7 7 Requires at least: 6.2 … … 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Streamline your content creation with AI-powered writing: The Ultimate AiWriter WordPress Plugin for Bloggers and Writers.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 Hey there 👋, welcome to AiWriter -the ultimate AI-powered WordPress plugin for all the bloggers, writers and copywriters out there!16 Welcome 👋 to AiWriter, the ultimate AI-powered WordPress plugin for all the bloggers, writers and copywriters out there! 17 17 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.18 If you want to create engaging, high-quality content faster, AiWriter is the tool for you. Powered by AI technology, my plugin simplifies the content creation process so you can focus on the creative aspects. 19 19 20 === A iContent Generation ===20 === AI Content Generation === 21 21 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.22 AiWriter helps you create unique, SEO-optimised content quickly and efficiently. Just type '+++' and let the magic happen! Take advantage of the cutting-edge ChatGPT language model to produce unique, engaging and informative content. 23 23 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.24 Whether you're a blogger, writer or copywriter, AiWriter is an essential tool for streamlining your workflow, increasing efficiency and improving the quality of your work. The AI content creation capabilities allow you to create content that is uniquely crafted to reflect your style and meet your needs. 25 25 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!26 Why wait? Install AiWriter today and bring the power of AI to content writing in WordPress. Improve your content creation process and produce high quality, engaging content that your readers will enjoy. Once you experience AiWriter, you'll never want to go back to your old content creation methods! 27 27 28 === TheAI for Content Creation ===28 === AI for Content Creation === 29 29 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 andstyle.30 AiWriter is powered by Chat-GPT, an advanced AI language model that uses natural language processing to generate content. With our AI-powered content creation features, you can effortlessly create content that is unique, engaging, informative and reflects your style. 31 31 32 === Do your research right inWordPress ===32 === Conduct research directly from WordPress === 33 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.34 We have some exciting news! As of version 0.8.0, we've integrated Chat-GPT into AiWriter, greatly expanding its capabilities. Now you can conduct extensive research and write insightful, engaging content from within WordPress. 35 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.36 Harness the power of AI-powered natural language processing with Chat-GPT to gain valuable insights and ideas for your content. No matter what keywords you need or what specific topic you want to address, Chat-GPT has you covered. You can now access Chat-GPT directly from AiWriter, streamlining the process of creating high-quality content. 37 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.38 If you are looking for a tool to help you create informative, unique content, look no further than AiWriter. With our latest update, you can bring the power of Chat-GPT to your WordPress experience and take your content creation to new heights. 39 39 40 40 === Important note ===
Note: See TracChangeset
for help on using the changeset viewer.