!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("fortressdb"),require("FDBLib").Components):"function"==typeof define&&define.amd?define("fortressdb",["fortressdb"],t):"object"==typeof exports?exports.fortressdb=t(require("fortressdb"),require("FDBLib").Components):(e.fortressdb=e.fortressdb||{},e.fortressdb.pages=e.fortressdb.pages||{},e.fortressdb.pages.developer=t(e.fortressdb,e.FDBLib.Components))}(self,((e,t)=>(()=>{"use strict";var r={4166:t=>{t.exports=e},4076:e=>{e.exports=t}},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var a=o[e]={exports:{}};return r[e](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{n.r(a),n.d(a,{render:()=>w});const e=window.wp.element,t=window.React;var r=n(4076),o=n(4166);function s(e,t,r,o,n,a,s){try{var i=e[a](s),c=i.value}catch(e){return void r(e)}i.done?t(c):Promise.resolve(c).then(o,n)}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o,n,a=[],s=!0,i=!1;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(a.push(o.value),!t||a.length!==t);s=!0);}catch(e){i=!0,n=e}finally{try{s||null==r.return||r.return()}finally{if(i)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const l=window.regeneratorRuntime;var u=n.n(l),d=r.Utils.useDictionary,p=new o.Endpoint("options"),f="fortressdb-page-developer",m=n.g.location,b=m.origin,v=m.pathname,h="".concat(b).concat(v,"?page=fortressdb_api");function y(){var a=c((0,t.useState)(!1),2),i=a[0],l=a[1],m=c((0,t.useState)(null),2),b=m[0],v=m[1],y=(0,t.useContext)(o.App.Context).state.options,g=(0,t.useCallback)(function(){var e,t=(e=u().mark((function e(t){var r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.target.checked,l(!0),e.prev=2,e.next=5,p.put({options:{apiTestTool:r}}).json();case 5:r?n.g.location.href=h:n.g.location.reload(),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(2),v(e.t0.message),l(!1);case 12:case"end":return e.stop()}}),e,null,[[2,8]])})),function(){var t=this,r=arguments;return new Promise((function(o,n){var a=e.apply(t,r);function i(e){s(a,o,n,i,c,"next",e)}function c(e){s(a,o,n,i,c,"throw",e)}i(void 0)}))});return function(e){return t.apply(this,arguments)}}()),w=d(),x=!!(y||{}).apiTestTool;return(0,e.createElement)("div",{className:f},(0,e.createElement)("div",{className:"".concat(f,"__banner")}),(0,e.createElement)("div",{className:"".concat(f,"__body")},(0,e.createElement)("div",{className:"".concat(f,"__title")},"What is the ",(0,e.createElement)("span",null,"API Test Tool"),"?"),(0,e.createElement)("div",{className:"".concat(f,"__note")},"FortressDB isn't just useful for forms, but for any custom WordPress development. We want developers          to use our API to build awesome features for their websites. To enable this, we've created an API          test tool, for both our REST and sockets APIs. The tool shows how to call the various methods,          endpoints, etc. You can try it live on this install. There is also documentation at ",(0,e.createElement)(r.Link,{href:"https://apidocs.fortressdb.com/"},"apidocs.fortressdb.com")),(0,e.createElement)("div",{className:"".concat(f,"__accept")},"To try the API test tool, click this checkbox.",(0,e.createElement)("div",{className:"".concat(f,"__checkbox")},(0,e.createElement)(r.Input,{type:"checkbox",checked:x,onChange:g,disabled:i}),w("enable-api-test-tool")))),i&&(0,e.createElement)(r.Spinner,null),(0,e.createElement)(r.Notify,{message:b,onClear:function(){return v(null)}}))}y.displayName="Developer";var g=r.Utils.renderDOM;function w(t){g((0,e.createElement)(o.App.Provider,null,(0,e.createElement)(o.App.Component,null,(0,e.createElement)(y,null))),t)}})(),a})()));