@gudhub/core 1.1.50 → 1.1.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -174,7 +174,7 @@ export class AppProcessor {
174
174
 
175
175
  async refreshApps(apps_id = []) {
176
176
  for (const app_id of apps_id) {
177
- if (app_id != undefined && this.storage.getApp(app_id)) {
177
+ if (app_id != undefined) {
178
178
  try {
179
179
  const app = await this.getAppApi(app_id);
180
180
  if (app) {
@@ -187,7 +187,7 @@ export class AppProcessor {
187
187
  }
188
188
  }
189
189
 
190
- this.storage.updateApp(app);
190
+ this.updatingAppInStorage(app);
191
191
  }
192
192
  } catch (err) {
193
193
  console.log(err);
@@ -1172,6 +1172,13 @@ export default function generateModulesList(async_modules_path, file_server_url,
1172
1172
  url: file_server_url + '/' + automation_modules_path + 'websites_checker.js',
1173
1173
  type: 'automation',
1174
1174
  icon: 'world'
1175
+ },
1176
+ {
1177
+ data_type: 'VoiceMachineDetection',
1178
+ name: 'Voice Machine Detection',
1179
+ url: file_server_url + '/' + automation_modules_path + 'voice_machine_detection.js',
1180
+ type: 'automation',
1181
+ icon: 'automation_calculator'
1175
1182
  }
1176
1183
  ]
1177
1184
  }
@@ -50,7 +50,7 @@ export class WebSocketApi {
50
50
  console.log("websocket close");
51
51
 
52
52
  this.connected = false;
53
- this.initWebSocket();
53
+ this.initWebSocket(this.onMassageHandler, this.refreshAppsHandler);
54
54
  }
55
55
 
56
56
  async onMessage(event) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gudhub/core",
3
- "version": "1.1.50",
3
+ "version": "1.1.52",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -104,13 +104,13 @@ var t="function"==typeof Map&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t
104
104
  },{}],"E3xI":[function(require,module,exports) {
105
105
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PipeService=void 0;var e=require("./utils.js");function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function t(e){return s(e)||i(e)||o(e)||n()}function n(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(e,r){if(e){if("string"==typeof e)return u(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?u(e,r):void 0}}function i(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function s(e){if(Array.isArray(e))return u(e)}function u(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function a(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function c(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function f(e,r,t){return r&&c(e.prototype,r),t&&c(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=b(e,"string");return"symbol"===r(t)?t:String(t)}function b(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var y=function(){function r(){a(this,r),this.subscribers={},this.messageBox={}}return f(r,[{key:"on",value:function(r,t,n){var o=this;return(0,e.checkParams)(r,t,n)&&r.split(" ").map(function(r){return r+":"+(0,e.createId)(t)}).forEach(function(e){o.subscribers[e]||(o.subscribers[e]=new Set),o.subscribers[e].add(n),o.checkMessageBox(e)}),this}},{key:"emit",value:function(r,t,n,o){var i=this;return r.split(" ").forEach(function(s){var u=s+":"+(0,e.createId)(t);if(i.subscribers[u]){if(0==i.subscribers[u].size)return i.messageBox[u]=[r,t,n,o,!1],i;i.subscribers[u].forEach(function(e){e(null,n,o)})}else i.messageBox[u]=[r,t,n,o,!1]}),this}},{key:"onRoot",value:function(e,r,t){return this.on(e,r,t)}},{key:"destroy",value:function(r,t,n){var o=this;return r.split(" ").forEach(function(r){var i=r+":"+(0,e.createId)(t);o.subscribers[i]&&n&&o.subscribers[i].delete(n),o.subscribers[i]&&!n&&delete o.subscribers[i]}),this}},{key:"checkMessageBox",value:function(e){var r=this;this.cleanMesssageBox(),this.messageBox[e]&&setTimeout(function(){r.messageBox[e]&&(r.emit.apply(r,t(r.messageBox[e])),r.messageBox[e][4]=!0)},0)}},{key:"cleanMesssageBox",value:function(){for(var e in this.messageBox)this.messageBox[e][4]&&delete this.messageBox[e]}}]),r}();exports.PipeService=y;
106
106
  },{"./utils.js":"Lc8J"}],"FJWL":[function(require,module,exports) {
107
- "use strict";function e(e,t,a){return[{data_type:"text",name:"Text",icon:"text_icon",url:t+"/"+e+"text_data.js",type:"gh_element",technology:"angular"},{data_type:"text_opt",name:"Options",icon:"option_gh_element",url:t+"/"+e+"text_options_data.js",type:"gh_element",technology:"angular"},{data_type:"number",name:"Number",icon:"number",url:t+"/"+e+"number_data.js",type:"gh_element",technology:"angular"},{data_type:"task_board",name:"Task Board",icon:"task_board",url:t+"/"+e+"task_board_data.js",type:"gh_element",technology:"angular"},{data_type:"visualizer",name:"visualizer",icon:"visualizer",url:t+"/"+e+"visualizer_data.js",type:"gh_element",technology:"angular"},{data_type:"enterprice_visualizer",name:"Enterprice Visualizer",icon:"visualizer",private:!0,url:t+"/"+e+"enterprice_visualizer_data.js",type:"gh_element",technology:"angular"},{data_type:"email",name:"Email",icon:"email",url:t+"/"+e+"email_data.js",type:"gh_element",technology:"angular"},{data_type:"date",name:"Date",icon:"date_gh_element",url:t+"/"+e+"date_data.js",type:"gh_element",technology:"angular"},{data_type:"radio_button",name:"Radio Button",icon:"radio_button_gh_element",url:t+"/"+e+"radio_button_data.js",type:"gh_element",technology:"angular"},{data_type:"radio_icon",name:"Radio icon",icon:"radio_icon_gh_element",url:t+"/"+e+"radio_icon_data.js",type:"gh_element",technology:"angular"},{data_type:"twilio_phone",name:"Twilio Phone",icon:"phone_twilio_gh_element",url:t+"/"+e+"twilio_phone_data.js",type:"gh_element",technology:"angular"},{data_type:"twilio_autodialer",name:"Twilio Auto Dialer",icon:"twilio_dialer",url:t+"/"+e+"twillio_autodialer_data.js",type:"gh_element",technology:"angular"},{data_type:"color",name:"Color",icon:"paint_gh_element",url:t+"/"+e+"color_data.js",type:"gh_element",technology:"angular"},{data_type:"charts",name:"Charts",icon:"graph_gh_element",url:t+"/"+e+"charts_data.js",type:"gh_element",technology:"angular"},{data_type:"funnel_chart",name:"Funnel chart",icon:"funnel_chart_gh_element",url:t+"/"+e+"funnel_chart_data.js",type:"gh_element",technology:"angular"},{data_type:"add_items_from_template",name:"Add items from template",icon:"contact_second",url:t+"/"+e+"add_items_from_template_data.js",type:"gh_element",technology:"angular"},{data_type:"item_ref",name:"Reference",icon:"reference",url:t+"/"+e+"itemRef_data.js",type:"gh_element",technology:"angular"},{data_type:"calendar",name:"Calendar",icon:"calendar",js:"https://gudhub.com/modules/FullCalendar-Gh-Element/dist/main.js",css:"https://gudhub.com/modules/FullCalendar-Gh-Element/dist/style.css",type:"gh_element",technology:"class"},{data_type:"data_ref",name:"Data Reference",icon:"data_reference",url:t+"/"+e+"data_ref_data.js",type:"gh_element",technology:"angular"},{data_type:"table",name:"Table",icon:"table",url:t+"/"+e+"table_data.js",type:"gh_element",technology:"angular"},{data_type:"tile",name:"Tile table",icon:"tile_table",url:t+"/"+e+"tile_data.js",type:"gh_element",technology:"angular"},{data_type:"file",name:"File",icon:"box",url:t+"/"+e+"file_data.js",type:"gh_element",technology:"angular"},{data_type:"image",name:"Image",icon:"image",url:t+"/"+e+"image_data.js",type:"gh_element",technology:"angular"},{data_type:"text_editor",name:"Text Editor",icon:"square",url:t+"/"+e+"text_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"tinymse",name:"Text editor MSE",icon:"tag",url:t+"/"+e+"tinymse_data.js",type:"gh_element",technology:"angular"},{data_type:"duration",name:"Duration",icon:"number_gh_element",url:t+"/"+e+"duration_data.js",type:"gh_element",technology:"angular"},{data_type:"user",name:"User",icon:"user_gh_element",url:t+"/"+e+"user_data.js",type:"gh_element",technology:"angular"},{data_type:"app",name:"App",icon:"app",url:t+"/"+e+"application_data.js",type:"gh_element",technology:"angular"},{data_type:"field",name:"Field",icon:"field_gh_element",url:t+"/"+e+"field_data.js",type:"gh_element",technology:"angular"},{data_type:"available",name:"Available",icon:"availible_gh_element",url:t+"/"+e+"available_data.js",type:"gh_element",technology:"angular"},{data_type:"view_list",name:"View List",icon:"view_list",url:t+"/"+e+"view_list_data.js",type:"gh_element",technology:"angular"},{data_type:"calculator",name:"Calculator",icon:"calculator",url:t+"/"+e+"calculator_data.js",type:"gh_element",technology:"angular"},{data_type:"string_join",name:"String Joiner",icon:"string_join_gh_element",url:t+"/"+e+"string_joiner_data.js",type:"gh_element",technology:"angular"},{data_type:"signature",name:"Signature",icon:"signature",url:t+"/"+e+"signature_data.js",type:"gh_element",technology:"angular"},{data_type:"sendEmail",name:"Send Email",icon:"send_email_gh_element",url:t+"/"+e+"send_email_data.js",type:"gh_element",technology:"angular"},{data_type:"boolean",name:"Yes/No",icon:"boolen_gh_element",url:t+"/"+e+"boolean_data.js",type:"gh_element",technology:"angular"},{data_type:"product_gallery",name:"Product gallery",icon:"product_gallery",url:t+"/"+e+"product_gallery_data.js",type:"gh_element",technology:"angular"},{data_type:"online_inventory",name:"Online inventory",icon:"slab",url:t+"/"+e+"online_inventory_data.js",type:"gh_element",technology:"angular"},{data_type:"3d_edges",name:"3D Edges",icon:"3d_edges_gh_element",url:t+"/"+e+"3d_edges_data.js",type:"gh_element",technology:"angular"},{data_type:"color_list",name:"Color list",icon:"circular_gh_element",url:t+"/"+e+"color_list_data.js",type:"gh_element",technology:"angular"},{data_type:"go_to_link",name:"Go to Link",icon:"go_to_link",url:t+"/"+e+"go_to_link_data.js",type:"gh_element",technology:"angular"},{data_type:"go_to_view",name:"Go to View",icon:"go_to_view",url:t+"/"+e+"go_to_view_data.js",type:"gh_element",technology:"angular"},{data_type:"range",name:"Range",icon:"range_gh_element",url:t+"/"+e+"range_data.js",type:"gh_element",technology:"angular"},{data_type:"barcode",name:"Barcode",icon:"barcode_gh_element",url:t+"/"+e+"barcode_data.js",type:"gh_element",technology:"angular"},{data_type:"item_remote_add",name:"Item remote add",icon:"remote_add_gh_element",url:t+"/"+e+"item_remote_add_data.js",type:"gh_element",technology:"angular"},{data_type:"item_remote_update",name:"Item remote update",icon:"remote_update_gh_element",url:t+"/"+e+"item_remote_update_data.js",type:"gh_element",technology:"angular"},{data_type:"timeline",name:"Timeline",icon:"timeline",url:t+"/"+e+"timeline_data.js",type:"gh_element",technology:"angular"},{data_type:"delete_item",name:"Delete Item",icon:"rubbish",url:t+"/"+e+"delete_action.js",type:"gh_element",technology:"angular"},{data_type:"print_doc",name:"Print document",icon:"print",url:t+"/"+e+"print_doc_action.js",type:"gh_element",technology:"angular"},{data_type:"open_item",name:"Open Item",icon:"delete",private:!0,url:t+"/"+e+"open_item_action.js",type:"gh_element",technology:"angular"},{data_type:"edit_template",name:"Edit template",icon:"delete",private:!0,url:t+"/"+e+"edit_template_action.js",type:"gh_element",technology:"angular"},{data_type:"open_app",private:!0,name:"Open App",icon:"delete",url:t+"/"+e+"open_app_action.js",type:"gh_element",technology:"angular"},{data_type:"user_settings",private:!0,name:"User Settings",icon:"delete",url:t+"/"+e+"user_settings_action.js",type:"gh_element",technology:"angular"},{data_type:"app_sharing",name:"Sharing",icon:"sharing",url:t+"/"+e+"sharing_action.js",type:"gh_element",technology:"angular"},{data_type:"app_constructor",private:!0,name:"App constructor",icon:"app_constructor",url:t+"/"+e+"app_constructor_action.js",type:"gh_element",technology:"angular"},{data_type:"app_settings",name:"App Settings",icon:"configuration",url:t+"/"+e+"app_settings_action.js",type:"gh_element",technology:"angular"},{data_type:"export_csv",name:"Export CSV",icon:"export_csv",url:t+"/"+e+"export_csv.js",type:"gh_element",technology:"angular"},{data_type:"import_csv",name:"Import CSV",icon:"import_csv",url:t+"/"+e+"import_csv.js",type:"gh_element",technology:"angular"},{data_type:"add_items",name:"Add Items",icon:"plus",url:t+"/"+e+"add_items_action.js",type:"gh_element",technology:"angular"},{data_type:"update_items",name:"Update Items",icon:"update",url:t+"/"+e+"update_items_action.js",type:"gh_element",technology:"angular"},{data_type:"install_app",name:"Install",icon:"install",url:t+"/"+e+"install_app_action.js",type:"gh_element",technology:"angular"},{data_type:"search_action",name:"Search",icon:"search",url:t+"/"+e+"search_action.js",type:"gh_element",technology:"angular"},{data_type:"filter_table",name:"Table filter",icon:"filter",url:t+"/"+e+"filter_table_action.js",type:"gh_element",technology:"angular"},{data_type:"slider",name:"Slider",icon:"slider",url:t+"/"+e+"slider_data.js",type:"gh_element",technology:"angular"},{data_type:"clone_item",name:"Clone Item",icon:"double_plus",url:t+"/"+e+"clone_item_action.js",type:"gh_element",technology:"angular"},{data_type:"close",name:"Close",icon:"cross",url:t+"/"+e+"close_action.js",type:"gh_element",technology:"angular"},{data_type:"phone",name:"Phone",icon:"phone_thin",url:t+"/"+e+"phone_data.js",type:"gh_element",technology:"angular"},{data_type:"link",name:"Link",icon:"link_gh_element",url:t+"/"+e+"link_data.js",type:"gh_element",technology:"angular"},{data_type:"sheduling",name:"Sheduling",icon:"scheduling",url:t+"/"+e+"sheduling_data.js",type:"gh_element",technology:"angular"},{data_type:"qrcode",name:"QR Code",icon:"qr_code",url:t+"/"+e+"qrcode_data.js",type:"gh_element",technology:"angular"},{data_type:"graph2d",name:"Graph",icon:"graph",url:t+"/"+e+"graph2d_data.js",type:"gh_element",technology:"angular"},{data_type:"quote_tool",name:"Quote tool",icon:"quoters",url:t+"/"+e+"quote_tool_data.js",type:"gh_element",technology:"angular"},{data_type:"cards",name:"Cards",icon:"cards",url:t+"/"+e+"cards_data.js",type:"gh_element",technology:"angular"},{data_type:"jsonConstructor",name:"Json Constructor",icon:"button",url:t+"/"+e+"json_constructor_data.js",type:"gh_element",technology:"angular"},{data_type:"button",name:"Button",icon:"button",js:"https://gudhub.com/modules/button_action/button_action.js",type:"gh_element",technology:"class"},{data_type:"editorjs",name:"EditorJS",icon:"code_editor",js:"https://gudhub.com/modules/Editor-Js/dist/main.js",css:"https://gudhub.com/modules/Editor-Js/dist/style.css",type:"gh_element",technology:"class"},{data_type:"filter_advanced",name:"Filter Advanced",icon:"filter_advanced",url:t+"/"+e+"filter_advanced_data.js",type:"gh_element",technology:"angular"},{data_type:"code_editor",name:"Code Editor",icon:"code_editor",url:t+"/"+e+"code_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"icon",name:"Icon",icon:"icon_gh_element",url:t+"/"+e+"icon_data.js",type:"gh_element",technology:"angular"},{data_type:"quoteRequest",name:"Quote Request",icon:"invoices",url:t+"/"+e+"quote_request_data.js",type:"gh_element",technology:"angular"},{data_type:"view_container",name:"View Container",icon:"pencil",url:t+"/"+e+"view_container_data.js",type:"gh_element",technology:"angular"},{data_type:"element_ref",name:"Element Reference",icon:"cloudSync_gh_element",url:t+"/"+e+"element_ref_data.js",type:"gh_element",technology:"angular"},{data_type:"quote_tool_objects_renderer",name:"Quote Tool Renderer",icon:"l_counter",url:t+"/"+e+"quote_tool_objects_renderer_data.js",type:"gh_element",technology:"angular"},{data_type:"quote_tool_objects_renderer_generator",name:"Quote Tool Parts Generator",icon:"l_counter_arrow",url:t+"/"+e+"quote_tool_objects_renderer_generator_data.js",type:"gh_element",technology:"angular"},{data_type:"trigger",name:"Trigger",icon:"job",url:t+"/"+e+"trigger_data.js",type:"gh_element",technology:"angular"},{data_type:"voting",name:"Voting",icon:"like_gh_element",url:t+"/"+e+"voting_data.js",type:"gh_element",technology:"angular"},{data_type:"view_tabs",name:"View Tab",icon:"tabs",url:t+"/"+e+"view_tabs.js",type:"gh_element",technology:"angular"},{data_type:"filter_tabs",name:"Filter Tabs",icon:"filter_tabs_gh_element",url:t+"/"+e+"filter_tabs.js",type:"gh_element",technology:"angular"},{data_type:"gps_coords",name:"GPS Coords",icon:"location_gh_element",url:t+"/"+e+"gps_coords.js",type:"gh_element",technology:"angular"},{data_type:"google_map",name:"Google Map",icon:"location",url:t+"/"+e+"google_map_data.js",type:"gh_element",technology:"angular"},{data_type:"data_migrations",name:"Data migrations",icon:"view_list_gh_element",url:t+"/"+e+"data_migrations.js",type:"gh_element",technology:"angular"},{data_type:"additional_settings",name:"Additional Settings",icon:"",private:!0,url:t+"/"+e+"gh_additional_settings_data.js",type:"gh_element",technology:"angular"},{data_type:"send_request",name:"Send Request",icon:"send_request_gh_element",url:t+"/"+e+"send_request_data.js",type:"gh_element",technology:"angular"},{data_type:"webcam",name:"Web camera",icon:"webcam_gh_element",url:t+"/"+e+"webcam_data.js",type:"gh_element",technology:"angular"},{data_type:"json_viewer",name:"JSON viewer",icon:"json_gh_element",url:t+"/"+e+"json_viewer_data.js",type:"gh_element",technology:"angular"},{data_type:"notifications",name:"Notifications",icon:"full_gh_element",url:t+"/"+e+"notifications_data.js",type:"gh_element",technology:"angular"},{data_type:"api",name:"API",icon:"job",url:t+"/"+e+"api_data.js",type:"gh_element",technology:"angular"},{data_type:"smart_input",name:"Smart Input",icon:"roket",url:t+"/"+e+"smart_input_data.js",type:"gh_element",technology:"angular"},{data_type:"json_editor",name:"JSON Editor",icon:"code",url:t+"/"+e+"json_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"grapes_html_editor",name:"Grapes Html Editor",icon:"code_editor",url:t+"/"+e+"grapes_html_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"quiz",name:"Quiz",icon:"quiz_gh_element",url:t+"/"+e+"quiz_data.js",type:"gh_element",technology:"angular"},{data_type:"password_input",name:"Password",icon:"lock_gh_element",url:t+"/"+e+"password_input_data.js",type:"gh_element",technology:"angular"},{data_type:"vs_code",name:"VS Code",icon:"code_editor",url:t+"/"+e+"vs_code_data.js",type:"gh_element",technology:"angular"},{data_type:"nested_list",name:"Nested List",icon:"scheduling",js:"https://gudhub.com/modules/Nested-List/dist/main.js",css:"https://gudhub.com/modules/Nested-List/dist/style.css",type:"gh_element",technology:"class"},{data_type:"countertop_smart_quote",name:"Countertop Smart Quote",icon:"quoters",url:t+"/"+e+"countertop_smart_quote_data.js",type:"gh_element",technology:"angular"},{data_type:"markdown_viewer",name:"Markdown viewer",icon:"code_editor",js:"https://gudhub.com/modules/markdown-it-gh-element/dist/main.js",css:"https://gudhub.com/modules/markdown-it-gh-element/dist/style.css",type:"gh_element",technology:"class"},{data_type:"html_viewer",name:"HTML Viewer",icon:"code_editor",js:"https://gudhub.com/modules/HTML-Viewer/dist/main.js",css:"https://gudhub.com/modules/HTML-Viewer/dist/style.css",type:"gh_element",technology:"class"},{data_type:"element_customizer",name:"Element Customizer",icon:"pencil",url:t+"/"+e+"element_customizer_data.js",type:"gh_element",technology:"angular"},{data_type:"API",name:"API",url:t+"/"+a+"api_node.js",type:"automation",icon:"automation_api",private:!0},{data_type:"Calculator",name:"Calculator",url:t+"/"+a+"calculator.js",type:"automation",icon:"automation_calculator"},{data_type:"CompareItems",name:"Compare Items",url:t+"/"+a+"compare_items.js",type:"automation",icon:"automation_compare_items"},{data_type:"Constants",name:"Constants",url:t+"/"+a+"constants.js",type:"automation",icon:"automation_constants"},{data_type:"CreateFiles",name:"Create Files",url:t+"/"+a+"create_files.js",type:"automation",icon:"automation_create_files"},{data_type:"CreateItemsApi",name:"Create Items Api",url:t+"/"+a+"create_item_api.js",type:"automation",icon:"automation_create_items_api"},{data_type:"FileDuplicate",name:"File Duplicate",url:t+"/"+a+"file_duplicate.js",type:"automation",icon:"automation_file_duplicate"},{data_type:"Filter",name:"Filter",url:t+"/"+a+"filter_node.js",type:"automation",icon:"filter"},{data_type:"GetItemByItemRef",name:"Get Item By Item Ref",url:t+"/"+a+"get_item_by_item_ref.js",type:"automation",icon:"automation_get_item_by_item_ref"},{data_type:"GetItems",name:"Get Items",url:t+"/"+a+"get_items.js",type:"automation",icon:"automation_get_items"},{data_type:"GhElementNode",name:"Gh Element Node",url:t+"/"+a+"gh_element_node.js",type:"automation",icon:"automation_gh_element_node",private:!0},{data_type:"IfCondition",name:"If Condition",url:t+"/"+a+"if_condition.js",type:"automation",icon:"automation_if_condition"},{data_type:"ItemConstructor",name:"Item Constructor",url:t+"/"+a+"item_constructor.js",type:"automation",icon:"automation_item_constructor"},{data_type:"ItemDestructor",name:"Item Destructor",url:t+"/"+a+"item_destructor.js",type:"automation",icon:"automation_item_destructor"},{data_type:"JSONScheme",name:"JSON Scheme",url:t+"/"+a+"json_scheme.js",type:"automation",icon:"automation_json_scheme"},{data_type:"MergeItems",name:"Merge Items",url:t+"/"+a+"merge_items.js",type:"automation",icon:"automation_merge_items"},{data_type:"MessageConstructor",name:"Message Constructor",url:t+"/"+a+"message_constructor.js",type:"automation",icon:"automation_message_constructor"},{data_type:"ObjectToItem",name:"Object To Item",url:t+"/"+a+"obj_to_item.js",type:"automation",icon:"automation_object_to_item"},{data_type:"ObjectConstructor",name:"Object Constructor",url:t+"/"+a+"object_constructor.js",type:"automation",icon:"automation_object_constructor"},{data_type:"ObjectDestructor",name:"Object Destructor",url:t+"/"+a+"object_destructor.js",type:"automation",icon:"automation_object_destructor"},{data_type:"PopulateElement",name:"Populate Element",url:t+"/"+a+"populate_element.js",type:"automation",icon:"automation_populate_element",private:!0},{data_type:"PopulateItems",name:"Populate Items",url:t+"/"+a+"populate_items.js",type:"automation",icon:"automation_populate_items"},{data_type:"PopulateWithDate",name:"Populate With Date",url:t+"/"+a+"populate_with_date.js",type:"automation",icon:"automation_populate_with_date"},{data_type:"PopulateWithItemRef",name:"Populate with Item Ref",url:t+"/"+a+"populate_with_item_ref.js",type:"automation",icon:"automation_populate_with_item_ref"},{data_type:"PopUpForm",name:"Pop Up Form",url:t+"/"+a+"popup_form.js",type:"automation",icon:"automation_pop_up_form",private:!0},{data_type:"QuizForm",name:"Quiz Form",url:t+"/"+a+"quiz_form.js",type:"automation",icon:"automation_quiz_form",private:!0},{data_type:"QuizNode",name:"Quiz Node",url:t+"/"+a+"quiz_node.js",type:"automation",icon:"automation_quiz_node",private:!0},{data_type:"Request",name:"Request",url:t+"/"+a+"request_node.js",type:"automation",icon:"automation_request"},{data_type:"Response",name:"Response",url:t+"/"+a+"response_node.js",type:"automation",icon:"automation_response",private:!0},{data_type:"SmartInput",name:"Smart Input",url:t+"/"+a+"smart_input.js",type:"automation",icon:"automation_smart_input",private:!0},{data_type:"Trigger",name:"Trigger",url:t+"/"+a+"trigger_node.js",type:"automation",icon:"automation_trigger",private:!0},{data_type:"TwilioSMS",name:"Twilio",url:t+"/"+a+"twilio_sms.js",type:"automation",icon:"automation_twilio"},{data_type:"UpdateItemsApi",name:"Update Items Api",url:t+"/"+a+"update_items_api.js",type:"automation",icon:"automation_update_items_api"},{data_type:"GoogleCalendar",name:"Google Calendar",url:t+"/"+a+"google_calendar.js",type:"automation",icon:"calendar"},{data_type:"VerifyEmail",name:"Verify email",url:t+"/"+a+"verify_email.js",type:"automation",icon:"check_in_circle"},{data_type:"Iterator",name:"Iterator",url:t+"/"+a+"iterator.js",type:"automation",icon:"update"},{data_type:"IteratorInput",name:"Iterator Input",url:t+"/"+a+"iterator_input.js",type:"automation",icon:"arrow_right",private:!0},{data_type:"IteratorOutput",name:"Iterator Output",url:t+"/"+a+"iterator_output.js",type:"automation",icon:"arrow_right",private:!0},{data_type:"SendEmail",name:"Send email",url:t+"/"+a+"send_email.js",type:"automation",icon:"email"},{data_type:"FileReader",name:"File Reader",url:t+"/"+a+"file_reader.js",type:"automation",icon:"file"},{data_type:"WebsitesChecker",name:"Websites Checker",url:t+"/"+a+"websites_checker.js",type:"automation",icon:"world"}]}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
107
+ "use strict";function e(e,t,a){return[{data_type:"text",name:"Text",icon:"text_icon",url:t+"/"+e+"text_data.js",type:"gh_element",technology:"angular"},{data_type:"text_opt",name:"Options",icon:"option_gh_element",url:t+"/"+e+"text_options_data.js",type:"gh_element",technology:"angular"},{data_type:"number",name:"Number",icon:"number",url:t+"/"+e+"number_data.js",type:"gh_element",technology:"angular"},{data_type:"task_board",name:"Task Board",icon:"task_board",url:t+"/"+e+"task_board_data.js",type:"gh_element",technology:"angular"},{data_type:"visualizer",name:"visualizer",icon:"visualizer",url:t+"/"+e+"visualizer_data.js",type:"gh_element",technology:"angular"},{data_type:"enterprice_visualizer",name:"Enterprice Visualizer",icon:"visualizer",private:!0,url:t+"/"+e+"enterprice_visualizer_data.js",type:"gh_element",technology:"angular"},{data_type:"email",name:"Email",icon:"email",url:t+"/"+e+"email_data.js",type:"gh_element",technology:"angular"},{data_type:"date",name:"Date",icon:"date_gh_element",url:t+"/"+e+"date_data.js",type:"gh_element",technology:"angular"},{data_type:"radio_button",name:"Radio Button",icon:"radio_button_gh_element",url:t+"/"+e+"radio_button_data.js",type:"gh_element",technology:"angular"},{data_type:"radio_icon",name:"Radio icon",icon:"radio_icon_gh_element",url:t+"/"+e+"radio_icon_data.js",type:"gh_element",technology:"angular"},{data_type:"twilio_phone",name:"Twilio Phone",icon:"phone_twilio_gh_element",url:t+"/"+e+"twilio_phone_data.js",type:"gh_element",technology:"angular"},{data_type:"twilio_autodialer",name:"Twilio Auto Dialer",icon:"twilio_dialer",url:t+"/"+e+"twillio_autodialer_data.js",type:"gh_element",technology:"angular"},{data_type:"color",name:"Color",icon:"paint_gh_element",url:t+"/"+e+"color_data.js",type:"gh_element",technology:"angular"},{data_type:"charts",name:"Charts",icon:"graph_gh_element",url:t+"/"+e+"charts_data.js",type:"gh_element",technology:"angular"},{data_type:"funnel_chart",name:"Funnel chart",icon:"funnel_chart_gh_element",url:t+"/"+e+"funnel_chart_data.js",type:"gh_element",technology:"angular"},{data_type:"add_items_from_template",name:"Add items from template",icon:"contact_second",url:t+"/"+e+"add_items_from_template_data.js",type:"gh_element",technology:"angular"},{data_type:"item_ref",name:"Reference",icon:"reference",url:t+"/"+e+"itemRef_data.js",type:"gh_element",technology:"angular"},{data_type:"calendar",name:"Calendar",icon:"calendar",js:"https://gudhub.com/modules/FullCalendar-Gh-Element/dist/main.js",css:"https://gudhub.com/modules/FullCalendar-Gh-Element/dist/style.css",type:"gh_element",technology:"class"},{data_type:"data_ref",name:"Data Reference",icon:"data_reference",url:t+"/"+e+"data_ref_data.js",type:"gh_element",technology:"angular"},{data_type:"table",name:"Table",icon:"table",url:t+"/"+e+"table_data.js",type:"gh_element",technology:"angular"},{data_type:"tile",name:"Tile table",icon:"tile_table",url:t+"/"+e+"tile_data.js",type:"gh_element",technology:"angular"},{data_type:"file",name:"File",icon:"box",url:t+"/"+e+"file_data.js",type:"gh_element",technology:"angular"},{data_type:"image",name:"Image",icon:"image",url:t+"/"+e+"image_data.js",type:"gh_element",technology:"angular"},{data_type:"text_editor",name:"Text Editor",icon:"square",url:t+"/"+e+"text_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"tinymse",name:"Text editor MSE",icon:"tag",url:t+"/"+e+"tinymse_data.js",type:"gh_element",technology:"angular"},{data_type:"duration",name:"Duration",icon:"number_gh_element",url:t+"/"+e+"duration_data.js",type:"gh_element",technology:"angular"},{data_type:"user",name:"User",icon:"user_gh_element",url:t+"/"+e+"user_data.js",type:"gh_element",technology:"angular"},{data_type:"app",name:"App",icon:"app",url:t+"/"+e+"application_data.js",type:"gh_element",technology:"angular"},{data_type:"field",name:"Field",icon:"field_gh_element",url:t+"/"+e+"field_data.js",type:"gh_element",technology:"angular"},{data_type:"available",name:"Available",icon:"availible_gh_element",url:t+"/"+e+"available_data.js",type:"gh_element",technology:"angular"},{data_type:"view_list",name:"View List",icon:"view_list",url:t+"/"+e+"view_list_data.js",type:"gh_element",technology:"angular"},{data_type:"calculator",name:"Calculator",icon:"calculator",url:t+"/"+e+"calculator_data.js",type:"gh_element",technology:"angular"},{data_type:"string_join",name:"String Joiner",icon:"string_join_gh_element",url:t+"/"+e+"string_joiner_data.js",type:"gh_element",technology:"angular"},{data_type:"signature",name:"Signature",icon:"signature",url:t+"/"+e+"signature_data.js",type:"gh_element",technology:"angular"},{data_type:"sendEmail",name:"Send Email",icon:"send_email_gh_element",url:t+"/"+e+"send_email_data.js",type:"gh_element",technology:"angular"},{data_type:"boolean",name:"Yes/No",icon:"boolen_gh_element",url:t+"/"+e+"boolean_data.js",type:"gh_element",technology:"angular"},{data_type:"product_gallery",name:"Product gallery",icon:"product_gallery",url:t+"/"+e+"product_gallery_data.js",type:"gh_element",technology:"angular"},{data_type:"online_inventory",name:"Online inventory",icon:"slab",url:t+"/"+e+"online_inventory_data.js",type:"gh_element",technology:"angular"},{data_type:"3d_edges",name:"3D Edges",icon:"3d_edges_gh_element",url:t+"/"+e+"3d_edges_data.js",type:"gh_element",technology:"angular"},{data_type:"color_list",name:"Color list",icon:"circular_gh_element",url:t+"/"+e+"color_list_data.js",type:"gh_element",technology:"angular"},{data_type:"go_to_link",name:"Go to Link",icon:"go_to_link",url:t+"/"+e+"go_to_link_data.js",type:"gh_element",technology:"angular"},{data_type:"go_to_view",name:"Go to View",icon:"go_to_view",url:t+"/"+e+"go_to_view_data.js",type:"gh_element",technology:"angular"},{data_type:"range",name:"Range",icon:"range_gh_element",url:t+"/"+e+"range_data.js",type:"gh_element",technology:"angular"},{data_type:"barcode",name:"Barcode",icon:"barcode_gh_element",url:t+"/"+e+"barcode_data.js",type:"gh_element",technology:"angular"},{data_type:"item_remote_add",name:"Item remote add",icon:"remote_add_gh_element",url:t+"/"+e+"item_remote_add_data.js",type:"gh_element",technology:"angular"},{data_type:"item_remote_update",name:"Item remote update",icon:"remote_update_gh_element",url:t+"/"+e+"item_remote_update_data.js",type:"gh_element",technology:"angular"},{data_type:"timeline",name:"Timeline",icon:"timeline",url:t+"/"+e+"timeline_data.js",type:"gh_element",technology:"angular"},{data_type:"delete_item",name:"Delete Item",icon:"rubbish",url:t+"/"+e+"delete_action.js",type:"gh_element",technology:"angular"},{data_type:"print_doc",name:"Print document",icon:"print",url:t+"/"+e+"print_doc_action.js",type:"gh_element",technology:"angular"},{data_type:"open_item",name:"Open Item",icon:"delete",private:!0,url:t+"/"+e+"open_item_action.js",type:"gh_element",technology:"angular"},{data_type:"edit_template",name:"Edit template",icon:"delete",private:!0,url:t+"/"+e+"edit_template_action.js",type:"gh_element",technology:"angular"},{data_type:"open_app",private:!0,name:"Open App",icon:"delete",url:t+"/"+e+"open_app_action.js",type:"gh_element",technology:"angular"},{data_type:"user_settings",private:!0,name:"User Settings",icon:"delete",url:t+"/"+e+"user_settings_action.js",type:"gh_element",technology:"angular"},{data_type:"app_sharing",name:"Sharing",icon:"sharing",url:t+"/"+e+"sharing_action.js",type:"gh_element",technology:"angular"},{data_type:"app_constructor",private:!0,name:"App constructor",icon:"app_constructor",url:t+"/"+e+"app_constructor_action.js",type:"gh_element",technology:"angular"},{data_type:"app_settings",name:"App Settings",icon:"configuration",url:t+"/"+e+"app_settings_action.js",type:"gh_element",technology:"angular"},{data_type:"export_csv",name:"Export CSV",icon:"export_csv",url:t+"/"+e+"export_csv.js",type:"gh_element",technology:"angular"},{data_type:"import_csv",name:"Import CSV",icon:"import_csv",url:t+"/"+e+"import_csv.js",type:"gh_element",technology:"angular"},{data_type:"add_items",name:"Add Items",icon:"plus",url:t+"/"+e+"add_items_action.js",type:"gh_element",technology:"angular"},{data_type:"update_items",name:"Update Items",icon:"update",url:t+"/"+e+"update_items_action.js",type:"gh_element",technology:"angular"},{data_type:"install_app",name:"Install",icon:"install",url:t+"/"+e+"install_app_action.js",type:"gh_element",technology:"angular"},{data_type:"search_action",name:"Search",icon:"search",url:t+"/"+e+"search_action.js",type:"gh_element",technology:"angular"},{data_type:"filter_table",name:"Table filter",icon:"filter",url:t+"/"+e+"filter_table_action.js",type:"gh_element",technology:"angular"},{data_type:"slider",name:"Slider",icon:"slider",url:t+"/"+e+"slider_data.js",type:"gh_element",technology:"angular"},{data_type:"clone_item",name:"Clone Item",icon:"double_plus",url:t+"/"+e+"clone_item_action.js",type:"gh_element",technology:"angular"},{data_type:"close",name:"Close",icon:"cross",url:t+"/"+e+"close_action.js",type:"gh_element",technology:"angular"},{data_type:"phone",name:"Phone",icon:"phone_thin",url:t+"/"+e+"phone_data.js",type:"gh_element",technology:"angular"},{data_type:"link",name:"Link",icon:"link_gh_element",url:t+"/"+e+"link_data.js",type:"gh_element",technology:"angular"},{data_type:"sheduling",name:"Sheduling",icon:"scheduling",url:t+"/"+e+"sheduling_data.js",type:"gh_element",technology:"angular"},{data_type:"qrcode",name:"QR Code",icon:"qr_code",url:t+"/"+e+"qrcode_data.js",type:"gh_element",technology:"angular"},{data_type:"graph2d",name:"Graph",icon:"graph",url:t+"/"+e+"graph2d_data.js",type:"gh_element",technology:"angular"},{data_type:"quote_tool",name:"Quote tool",icon:"quoters",url:t+"/"+e+"quote_tool_data.js",type:"gh_element",technology:"angular"},{data_type:"cards",name:"Cards",icon:"cards",url:t+"/"+e+"cards_data.js",type:"gh_element",technology:"angular"},{data_type:"jsonConstructor",name:"Json Constructor",icon:"button",url:t+"/"+e+"json_constructor_data.js",type:"gh_element",technology:"angular"},{data_type:"button",name:"Button",icon:"button",js:"https://gudhub.com/modules/button_action/button_action.js",type:"gh_element",technology:"class"},{data_type:"editorjs",name:"EditorJS",icon:"code_editor",js:"https://gudhub.com/modules/Editor-Js/dist/main.js",css:"https://gudhub.com/modules/Editor-Js/dist/style.css",type:"gh_element",technology:"class"},{data_type:"filter_advanced",name:"Filter Advanced",icon:"filter_advanced",url:t+"/"+e+"filter_advanced_data.js",type:"gh_element",technology:"angular"},{data_type:"code_editor",name:"Code Editor",icon:"code_editor",url:t+"/"+e+"code_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"icon",name:"Icon",icon:"icon_gh_element",url:t+"/"+e+"icon_data.js",type:"gh_element",technology:"angular"},{data_type:"quoteRequest",name:"Quote Request",icon:"invoices",url:t+"/"+e+"quote_request_data.js",type:"gh_element",technology:"angular"},{data_type:"view_container",name:"View Container",icon:"pencil",url:t+"/"+e+"view_container_data.js",type:"gh_element",technology:"angular"},{data_type:"element_ref",name:"Element Reference",icon:"cloudSync_gh_element",url:t+"/"+e+"element_ref_data.js",type:"gh_element",technology:"angular"},{data_type:"quote_tool_objects_renderer",name:"Quote Tool Renderer",icon:"l_counter",url:t+"/"+e+"quote_tool_objects_renderer_data.js",type:"gh_element",technology:"angular"},{data_type:"quote_tool_objects_renderer_generator",name:"Quote Tool Parts Generator",icon:"l_counter_arrow",url:t+"/"+e+"quote_tool_objects_renderer_generator_data.js",type:"gh_element",technology:"angular"},{data_type:"trigger",name:"Trigger",icon:"job",url:t+"/"+e+"trigger_data.js",type:"gh_element",technology:"angular"},{data_type:"voting",name:"Voting",icon:"like_gh_element",url:t+"/"+e+"voting_data.js",type:"gh_element",technology:"angular"},{data_type:"view_tabs",name:"View Tab",icon:"tabs",url:t+"/"+e+"view_tabs.js",type:"gh_element",technology:"angular"},{data_type:"filter_tabs",name:"Filter Tabs",icon:"filter_tabs_gh_element",url:t+"/"+e+"filter_tabs.js",type:"gh_element",technology:"angular"},{data_type:"gps_coords",name:"GPS Coords",icon:"location_gh_element",url:t+"/"+e+"gps_coords.js",type:"gh_element",technology:"angular"},{data_type:"google_map",name:"Google Map",icon:"location",url:t+"/"+e+"google_map_data.js",type:"gh_element",technology:"angular"},{data_type:"data_migrations",name:"Data migrations",icon:"view_list_gh_element",url:t+"/"+e+"data_migrations.js",type:"gh_element",technology:"angular"},{data_type:"additional_settings",name:"Additional Settings",icon:"",private:!0,url:t+"/"+e+"gh_additional_settings_data.js",type:"gh_element",technology:"angular"},{data_type:"send_request",name:"Send Request",icon:"send_request_gh_element",url:t+"/"+e+"send_request_data.js",type:"gh_element",technology:"angular"},{data_type:"webcam",name:"Web camera",icon:"webcam_gh_element",url:t+"/"+e+"webcam_data.js",type:"gh_element",technology:"angular"},{data_type:"json_viewer",name:"JSON viewer",icon:"json_gh_element",url:t+"/"+e+"json_viewer_data.js",type:"gh_element",technology:"angular"},{data_type:"notifications",name:"Notifications",icon:"full_gh_element",url:t+"/"+e+"notifications_data.js",type:"gh_element",technology:"angular"},{data_type:"api",name:"API",icon:"job",url:t+"/"+e+"api_data.js",type:"gh_element",technology:"angular"},{data_type:"smart_input",name:"Smart Input",icon:"roket",url:t+"/"+e+"smart_input_data.js",type:"gh_element",technology:"angular"},{data_type:"json_editor",name:"JSON Editor",icon:"code",url:t+"/"+e+"json_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"grapes_html_editor",name:"Grapes Html Editor",icon:"code_editor",url:t+"/"+e+"grapes_html_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"quiz",name:"Quiz",icon:"quiz_gh_element",url:t+"/"+e+"quiz_data.js",type:"gh_element",technology:"angular"},{data_type:"password_input",name:"Password",icon:"lock_gh_element",url:t+"/"+e+"password_input_data.js",type:"gh_element",technology:"angular"},{data_type:"vs_code",name:"VS Code",icon:"code_editor",url:t+"/"+e+"vs_code_data.js",type:"gh_element",technology:"angular"},{data_type:"nested_list",name:"Nested List",icon:"scheduling",js:"https://gudhub.com/modules/Nested-List/dist/main.js",css:"https://gudhub.com/modules/Nested-List/dist/style.css",type:"gh_element",technology:"class"},{data_type:"countertop_smart_quote",name:"Countertop Smart Quote",icon:"quoters",url:t+"/"+e+"countertop_smart_quote_data.js",type:"gh_element",technology:"angular"},{data_type:"markdown_viewer",name:"Markdown viewer",icon:"code_editor",js:"https://gudhub.com/modules/markdown-it-gh-element/dist/main.js",css:"https://gudhub.com/modules/markdown-it-gh-element/dist/style.css",type:"gh_element",technology:"class"},{data_type:"html_viewer",name:"HTML Viewer",icon:"code_editor",js:"https://gudhub.com/modules/HTML-Viewer/dist/main.js",css:"https://gudhub.com/modules/HTML-Viewer/dist/style.css",type:"gh_element",technology:"class"},{data_type:"element_customizer",name:"Element Customizer",icon:"pencil",url:t+"/"+e+"element_customizer_data.js",type:"gh_element",technology:"angular"},{data_type:"API",name:"API",url:t+"/"+a+"api_node.js",type:"automation",icon:"automation_api",private:!0},{data_type:"Calculator",name:"Calculator",url:t+"/"+a+"calculator.js",type:"automation",icon:"automation_calculator"},{data_type:"CompareItems",name:"Compare Items",url:t+"/"+a+"compare_items.js",type:"automation",icon:"automation_compare_items"},{data_type:"Constants",name:"Constants",url:t+"/"+a+"constants.js",type:"automation",icon:"automation_constants"},{data_type:"CreateFiles",name:"Create Files",url:t+"/"+a+"create_files.js",type:"automation",icon:"automation_create_files"},{data_type:"CreateItemsApi",name:"Create Items Api",url:t+"/"+a+"create_item_api.js",type:"automation",icon:"automation_create_items_api"},{data_type:"FileDuplicate",name:"File Duplicate",url:t+"/"+a+"file_duplicate.js",type:"automation",icon:"automation_file_duplicate"},{data_type:"Filter",name:"Filter",url:t+"/"+a+"filter_node.js",type:"automation",icon:"filter"},{data_type:"GetItemByItemRef",name:"Get Item By Item Ref",url:t+"/"+a+"get_item_by_item_ref.js",type:"automation",icon:"automation_get_item_by_item_ref"},{data_type:"GetItems",name:"Get Items",url:t+"/"+a+"get_items.js",type:"automation",icon:"automation_get_items"},{data_type:"GhElementNode",name:"Gh Element Node",url:t+"/"+a+"gh_element_node.js",type:"automation",icon:"automation_gh_element_node",private:!0},{data_type:"IfCondition",name:"If Condition",url:t+"/"+a+"if_condition.js",type:"automation",icon:"automation_if_condition"},{data_type:"ItemConstructor",name:"Item Constructor",url:t+"/"+a+"item_constructor.js",type:"automation",icon:"automation_item_constructor"},{data_type:"ItemDestructor",name:"Item Destructor",url:t+"/"+a+"item_destructor.js",type:"automation",icon:"automation_item_destructor"},{data_type:"JSONScheme",name:"JSON Scheme",url:t+"/"+a+"json_scheme.js",type:"automation",icon:"automation_json_scheme"},{data_type:"MergeItems",name:"Merge Items",url:t+"/"+a+"merge_items.js",type:"automation",icon:"automation_merge_items"},{data_type:"MessageConstructor",name:"Message Constructor",url:t+"/"+a+"message_constructor.js",type:"automation",icon:"automation_message_constructor"},{data_type:"ObjectToItem",name:"Object To Item",url:t+"/"+a+"obj_to_item.js",type:"automation",icon:"automation_object_to_item"},{data_type:"ObjectConstructor",name:"Object Constructor",url:t+"/"+a+"object_constructor.js",type:"automation",icon:"automation_object_constructor"},{data_type:"ObjectDestructor",name:"Object Destructor",url:t+"/"+a+"object_destructor.js",type:"automation",icon:"automation_object_destructor"},{data_type:"PopulateElement",name:"Populate Element",url:t+"/"+a+"populate_element.js",type:"automation",icon:"automation_populate_element",private:!0},{data_type:"PopulateItems",name:"Populate Items",url:t+"/"+a+"populate_items.js",type:"automation",icon:"automation_populate_items"},{data_type:"PopulateWithDate",name:"Populate With Date",url:t+"/"+a+"populate_with_date.js",type:"automation",icon:"automation_populate_with_date"},{data_type:"PopulateWithItemRef",name:"Populate with Item Ref",url:t+"/"+a+"populate_with_item_ref.js",type:"automation",icon:"automation_populate_with_item_ref"},{data_type:"PopUpForm",name:"Pop Up Form",url:t+"/"+a+"popup_form.js",type:"automation",icon:"automation_pop_up_form",private:!0},{data_type:"QuizForm",name:"Quiz Form",url:t+"/"+a+"quiz_form.js",type:"automation",icon:"automation_quiz_form",private:!0},{data_type:"QuizNode",name:"Quiz Node",url:t+"/"+a+"quiz_node.js",type:"automation",icon:"automation_quiz_node",private:!0},{data_type:"Request",name:"Request",url:t+"/"+a+"request_node.js",type:"automation",icon:"automation_request"},{data_type:"Response",name:"Response",url:t+"/"+a+"response_node.js",type:"automation",icon:"automation_response",private:!0},{data_type:"SmartInput",name:"Smart Input",url:t+"/"+a+"smart_input.js",type:"automation",icon:"automation_smart_input",private:!0},{data_type:"Trigger",name:"Trigger",url:t+"/"+a+"trigger_node.js",type:"automation",icon:"automation_trigger",private:!0},{data_type:"TwilioSMS",name:"Twilio",url:t+"/"+a+"twilio_sms.js",type:"automation",icon:"automation_twilio"},{data_type:"UpdateItemsApi",name:"Update Items Api",url:t+"/"+a+"update_items_api.js",type:"automation",icon:"automation_update_items_api"},{data_type:"GoogleCalendar",name:"Google Calendar",url:t+"/"+a+"google_calendar.js",type:"automation",icon:"calendar"},{data_type:"VerifyEmail",name:"Verify email",url:t+"/"+a+"verify_email.js",type:"automation",icon:"check_in_circle"},{data_type:"Iterator",name:"Iterator",url:t+"/"+a+"iterator.js",type:"automation",icon:"update"},{data_type:"IteratorInput",name:"Iterator Input",url:t+"/"+a+"iterator_input.js",type:"automation",icon:"arrow_right",private:!0},{data_type:"IteratorOutput",name:"Iterator Output",url:t+"/"+a+"iterator_output.js",type:"automation",icon:"arrow_right",private:!0},{data_type:"SendEmail",name:"Send email",url:t+"/"+a+"send_email.js",type:"automation",icon:"email"},{data_type:"FileReader",name:"File Reader",url:t+"/"+a+"file_reader.js",type:"automation",icon:"file"},{data_type:"WebsitesChecker",name:"Websites Checker",url:t+"/"+a+"websites_checker.js",type:"automation",icon:"world"},{data_type:"VoiceMachineDetection",name:"Voice Machine Detection",url:t+"/"+a+"voice_machine_detection.js",type:"automation",icon:"automation_calculator"}]}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
108
108
  },{}],"CSHe":[function(require,module,exports) {
109
109
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Storage=void 0;var t=e(require("./ModulesList.js"));function e(t){return t&&t.__esModule?t:{default:t}}function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t){return u(t)||a(t)||o(t)||i()}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(t,e){if(t){if("string"==typeof t)return s(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(t,e):void 0}}function a(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t){if(Array.isArray(t))return s(t)}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function c(){c=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(A){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),u=new S(n||[]);return i(a,"_invoke",{value:O(t,r,u)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(A){return{type:"throw",arg:A}}}t.wrap=f;var h={};function v(){}function y(){}function d(){}var m={};l(m,a,function(){return this});var g=Object.getPrototypeOf,b=g&&g(g(E([])));b&&b!==e&&n.call(b,a)&&(m=b);var w=d.prototype=v.prototype=Object.create(m);function _(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function L(t,e){var o;i(this,"_invoke",{value:function(i,a){function u(){return new e(function(o,u){!function i(o,a,u,s){var c=p(t[o],t,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then(function(t){i("next",t,u,s)},function(t){i("throw",t,u,s)}):e.resolve(f).then(function(t){l.value=t,u(l)},function(t){return i("throw",t,u,s)})}s(c.arg)}(i,a,o,u)})}return o=o?o.then(u,u):u()}})}function O(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return P()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var u=x(a,r);if(u){if(u===h)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=p(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,h;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function E(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:P}}function P(){return{value:void 0,done:!0}}return y.prototype=d,i(w,"constructor",{value:d,configurable:!0}),i(d,"constructor",{value:y,configurable:!0}),y.displayName=l(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,l(t,s,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},_(L.prototype),l(L.prototype,u,function(){return this}),t.AsyncIterator=L,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new L(f(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},_(w),l(w,s,"Generator"),l(w,a,function(){return this}),l(w,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=E,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;k(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function l(t,e,r,n,i,o,a){try{var u=t[o](a),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,i)}function f(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){l(o,n,i,a,u,"next",t)}function u(t){l(o,n,i,a,u,"throw",t)}a(void 0)})}}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach(function(e){v(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function v(t,e,r){return(e=g(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,g(n.key),n)}}function m(t,e,r){return e&&d(t.prototype,e),r&&d(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function g(t){var e=b(t,"string");return"symbol"===r(e)?e:String(e)}function b(t,e){if("object"!==r(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var w=function(){function e(r,n,i){y(this,e),this.apps_list=[],this.users_list=[],this.user={},this.modulesList=(0,t.default)(r,n,i),this.ghComponentsPromises=[]}return m(e,[{key:"getMainStorage",value:function(){return this}},{key:"getAppsList",value:function(){return this.apps_list}},{key:"getUser",value:function(){return this.user}},{key:"getUsersList",value:function(){return this.users_list}},{key:"getModulesList",value:function(t,e){return void 0===t?this.modulesList:0==e?this.modulesList.filter(function(e){return e.type===t&&!e.private}):this.modulesList.filter(function(e){return e.type===t})}},{key:"getModuleUrl",value:function(t){return this.modulesList.find(function(e){return e.data_type==t})}},{key:"setUser",value:function(t){this.user=t,this.users_list.push(t)}},{key:"updateUser",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.avatar_128&&(t.avatar_128=t.avatar_128+"?"+(new Date).getTime()),t.avatar_512&&(t.avatar_512=t.avatar_512+"?"+(new Date).getTime()),this.user=h(h({},this.user),t),this.users_list=this.users_list.filter(function(e){return e.user_id!=t.user_id}),this.users_list.push(this.user)}},{key:"unsetUser",value:function(){this.user={}}},{key:"getApp",value:function(t){for(var e=0;e<this.apps_list.length;e++)if(this.apps_list[e].app_id==t)return this.apps_list[e]}},{key:"unsetApps",value:function(){this.apps_list=[]}},{key:"updateApp",value:function(t){return this.apps_list=this.apps_list.map(function(e){return e.app_id==t.app_id?t:e}),this.apps_list}},{key:"deleteApp",value:function(t){return this.apps_list=this.apps_list.filter(function(e){return e.app_id!=t}),this.apps_list}},{key:"updateItemsInApp",value:function(){var t=f(c().mark(function t(e,r){var n;return c().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getApp(r);case 2:return(n=t.sent)&&(n.items_list=updateItems(e,n.items_list,this.pipeService.emit.bind(this.pipeService),r),this.updateApp(n)),t.abrupt("return",n);case 5:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"addItemsToApp",value:function(){var t=f(c().mark(function t(e,r){var i,o;return c().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getApp(r);case 2:return(i=t.sent)&&((o=i.items_list).push.apply(o,n(e)),this.updateApp(i),this.pipeService.emit("gh_items_update",{app_id:r},e)),t.abrupt("return",i);case 5:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"deleteItemsInApp",value:function(){var t=f(c().mark(function t(e,r){var n;return c().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getApp(r);case 2:return(n=t.sent)&&(n.items_list=n.items_list.filter(function(t){return!e.find(function(e){return e.item_id==t.item_id})}),this.updateApp(n)),t.abrupt("return",n);case 5:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()}]),e}();exports.Storage=w;
110
110
  },{"./ModulesList.js":"FJWL"}],"p58b":[function(require,module,exports) {
111
111
  "use strict";module.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")};
112
112
  },{}],"pHMV":[function(require,module,exports) {
113
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WebSocketApi=void 0;var t=e(require("ws"));function e(t){return t&&t.__esModule?t:{default:t}}function r(){r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(B){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new O(n||[]);return o(a,"_invoke",{value:E(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(B){return{type:"throw",arg:B}}}t.wrap=f;var p={};function d(){}function v(){}function y(){}var w={};h(w,c,function(){return this});var m=Object.getPrototypeOf,g=m&&m(m(T([])));g&&g!==e&&n.call(g,c)&&(w=g);var b=y.prototype=d.prototype=Object.create(w);function k(t){["next","throw","return"].forEach(function(e){h(t,e,function(t){return this._invoke(e,t)})})}function x(t,e){var r;o(this,"_invoke",{value:function(o,a){function c(){return new e(function(r,c){!function r(o,a,c,s){var u=l(t[o],t,a);if("throw"!==u.type){var h=u.arg,f=h.value;return f&&"object"==i(f)&&n.call(f,"__await")?e.resolve(f.__await).then(function(t){r("next",t,c,s)},function(t){r("throw",t,c,s)}):e.resolve(f).then(function(t){h.value=t,c(h)},function(t){return r("throw",t,c,s)})}s(u.arg)}(o,a,r,c)})}return r=r?r.then(c,c):c()}})}function E(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=L(a,r);if(c){if(c===p)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===p)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function L(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,L(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,p;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function T(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return v.prototype=y,o(b,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:v,configurable:!0}),v.displayName=h(y,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,h(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},k(x.prototype),h(x.prototype,s,function(){return this}),t.AsyncIterator=x,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new x(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},k(b),h(b,u,"Generator"),h(b,c,function(){return this}),h(b,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=T,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:T(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function n(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(u){return void r(u)}c.done?e(s):Promise.resolve(s).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise(function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,s,"next",t)}function s(t){n(a,o,i,c,s,"throw",t)}c(void 0)})}}function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}}function s(t,e,r){return e&&c(t.prototype,e),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=h(t,"string");return"symbol"===i(e)?e:String(e)}function h(t,e){if("object"!==i(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var f=function(){function e(t,r){a(this,e),this.websocket=null,this.connected=!1,this.queue=[],this.url=t,this.auth=r,this.heartBeatTimeStemp=1e13,this.ALLOWED_HEART_BEAT_DELEY=12e3,this.firstHeartBeat=!0,this.reload=!0,this.isBrowser=!["undefined"==typeof window?"undefined":i(window),"undefined"==typeof document?"undefined":i(document)].includes("undefined")}return s(e,[{key:"addSubscription",value:function(){var t=o(r().mark(function t(e){var n,o;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.auth.getToken();case 2:n=t.sent,o="token=".concat(n,"/~/app_id=").concat(e),this.connected&&this.websocket.send(o),this.queue.push(e);case 6:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"onOpen",value:function(){var t=o(r().mark(function t(){var e,n=this;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.reload=!0,console.log("websocket opened"),this.connected=!0,t.next=5,this.auth.getToken();case 5:e=t.sent,this.queue.forEach(function(t){var r="token=".concat(e,"/~/app_id=").concat(t);n.websocket.send(r)});case 7:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"onError",value:function(t){console.log("websocket error: ",t),this.websocket.close()}},{key:"onClose",value:function(){console.log("websocket close"),this.connected=!1,this.initWebSocket()}},{key:"onMessage",value:function(){var t=o(r().mark(function t(e){var n,o,i,a;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=this.isBrowser?e.data:e).match(/HeartBeat/)){t.next=10;break}if(o=(new Date).getTime()-this.heartBeatTimeStemp,!(this.ALLOWED_HEART_BEAT_DELEY<o)){t.next=8;break}return t.next=6,this.onConnectionLost();case 6:t.next=10;break;case 8:this.websocket.send("HeartBeat"),this.heartBeatTimeStemp=(new Date).getTime();case 10:if(this.firstHeartBeat&&(this.connectionChecker(),this.firstHeartBeat=!1),!n.match(/[{}]/)){t.next=17;break}return i=JSON.parse(n),t.next=15,this.auth.getToken();case 15:a=t.sent,i.token!=a&&this.onMassageHandler(i);case 17:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"initWebSocket",value:function(e,r){this.onMassageHandler=e,this.refreshAppsHandler=r,this.isBrowser?(this.websocket=new WebSocket(this.url),this.websocket.onopen=this.onOpen.bind(this),this.websocket.onerror=this.onError.bind(this),this.websocket.onclose=this.onClose.bind(this),this.websocket.onmessage=this.onMessage.bind(this)):(this.websocket=new t.default(this.url),this.websocket.on("open",this.onOpen),this.websocket.on("error",this.onError),this.websocket.on("close",this.onClose),this.websocket.on("message",this.onMessage)),console.log("websocket initialized")}},{key:"connectionChecker",value:function(){var t=this;setInterval(o(r().mark(function e(){var n;return r().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(new Date).getTime()-t.heartBeatTimeStemp,!(t.ALLOWED_HEART_BEAT_DELEY<n)){e.next=4;break}return e.next=4,t.onConnectionLost();case 4:case"end":return e.stop()}},e)})),1e3)}},{key:"onConnectionLost",value:function(){var t=o(r().mark(function t(){return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.auth.getVersion();case 3:this.reload&&(this.reload=!1,console.log("Connected"),this.heartBeatTimeStemp=1e13,this.websocket.close(),this.refreshAppsHandler(this.queue)),t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),console.log(t.t0);case 9:case"end":return t.stop()}},t,this,[[0,6]])}));return function(){return t.apply(this,arguments)}}()}]),e}();exports.WebSocketApi=f;
113
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WebSocketApi=void 0;var t=e(require("ws"));function e(t){return t&&t.__esModule?t:{default:t}}function r(){r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(A){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new O(n||[]);return o(a,"_invoke",{value:E(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(A){return{type:"throw",arg:A}}}t.wrap=f;var p={};function d(){}function v(){}function y(){}var w={};h(w,c,function(){return this});var m=Object.getPrototypeOf,g=m&&m(m(T([])));g&&g!==e&&n.call(g,c)&&(w=g);var b=y.prototype=d.prototype=Object.create(w);function k(t){["next","throw","return"].forEach(function(e){h(t,e,function(t){return this._invoke(e,t)})})}function x(t,e){var r;o(this,"_invoke",{value:function(o,a){function c(){return new e(function(r,c){!function r(o,a,c,s){var u=l(t[o],t,a);if("throw"!==u.type){var h=u.arg,f=h.value;return f&&"object"==i(f)&&n.call(f,"__await")?e.resolve(f.__await).then(function(t){r("next",t,c,s)},function(t){r("throw",t,c,s)}):e.resolve(f).then(function(t){h.value=t,c(h)},function(t){return r("throw",t,c,s)})}s(u.arg)}(o,a,r,c)})}return r=r?r.then(c,c):c()}})}function E(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=L(a,r);if(c){if(c===p)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===p)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function L(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,L(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,p;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function T(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return v.prototype=y,o(b,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:v,configurable:!0}),v.displayName=h(y,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,h(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},k(x.prototype),h(x.prototype,s,function(){return this}),t.AsyncIterator=x,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new x(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},k(b),h(b,u,"Generator"),h(b,c,function(){return this}),h(b,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=T,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:T(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function n(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(u){return void r(u)}c.done?e(s):Promise.resolve(s).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise(function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,s,"next",t)}function s(t){n(a,o,i,c,s,"throw",t)}c(void 0)})}}function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}}function s(t,e,r){return e&&c(t.prototype,e),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=h(t,"string");return"symbol"===i(e)?e:String(e)}function h(t,e){if("object"!==i(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var f=function(){function e(t,r){a(this,e),this.websocket=null,this.connected=!1,this.queue=[],this.url=t,this.auth=r,this.heartBeatTimeStemp=1e13,this.ALLOWED_HEART_BEAT_DELEY=12e3,this.firstHeartBeat=!0,this.reload=!0,this.isBrowser=!["undefined"==typeof window?"undefined":i(window),"undefined"==typeof document?"undefined":i(document)].includes("undefined")}return s(e,[{key:"addSubscription",value:function(){var t=o(r().mark(function t(e){var n,o;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.auth.getToken();case 2:n=t.sent,o="token=".concat(n,"/~/app_id=").concat(e),this.connected&&this.websocket.send(o),this.queue.push(e);case 6:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"onOpen",value:function(){var t=o(r().mark(function t(){var e,n=this;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.reload=!0,console.log("websocket opened"),this.connected=!0,t.next=5,this.auth.getToken();case 5:e=t.sent,this.queue.forEach(function(t){var r="token=".concat(e,"/~/app_id=").concat(t);n.websocket.send(r)});case 7:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"onError",value:function(t){console.log("websocket error: ",t),this.websocket.close()}},{key:"onClose",value:function(){console.log("websocket close"),this.connected=!1,this.initWebSocket(this.onMassageHandler,this.refreshAppsHandler)}},{key:"onMessage",value:function(){var t=o(r().mark(function t(e){var n,o,i,a;return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=this.isBrowser?e.data:e).match(/HeartBeat/)){t.next=10;break}if(o=(new Date).getTime()-this.heartBeatTimeStemp,!(this.ALLOWED_HEART_BEAT_DELEY<o)){t.next=8;break}return t.next=6,this.onConnectionLost();case 6:t.next=10;break;case 8:this.websocket.send("HeartBeat"),this.heartBeatTimeStemp=(new Date).getTime();case 10:if(this.firstHeartBeat&&(this.connectionChecker(),this.firstHeartBeat=!1),!n.match(/[{}]/)){t.next=17;break}return i=JSON.parse(n),t.next=15,this.auth.getToken();case 15:a=t.sent,i.token!=a&&this.onMassageHandler(i);case 17:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"initWebSocket",value:function(e,r){this.onMassageHandler=e,this.refreshAppsHandler=r,this.isBrowser?(this.websocket=new WebSocket(this.url),this.websocket.onopen=this.onOpen.bind(this),this.websocket.onerror=this.onError.bind(this),this.websocket.onclose=this.onClose.bind(this),this.websocket.onmessage=this.onMessage.bind(this)):(this.websocket=new t.default(this.url),this.websocket.on("open",this.onOpen),this.websocket.on("error",this.onError),this.websocket.on("close",this.onClose),this.websocket.on("message",this.onMessage)),console.log("websocket initialized")}},{key:"connectionChecker",value:function(){var t=this;setInterval(o(r().mark(function e(){var n;return r().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(new Date).getTime()-t.heartBeatTimeStemp,!(t.ALLOWED_HEART_BEAT_DELEY<n)){e.next=4;break}return e.next=4,t.onConnectionLost();case 4:case"end":return e.stop()}},e)})),1e3)}},{key:"onConnectionLost",value:function(){var t=o(r().mark(function t(){return r().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.auth.getVersion();case 3:this.reload&&(this.reload=!1,console.log("Connected"),this.heartBeatTimeStemp=1e13,this.websocket.close(),this.refreshAppsHandler(this.queue)),t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),console.log(t.t0);case 9:case"end":return t.stop()}},t,this,[[0,6]])}));return function(){return t.apply(this,arguments)}}()}]),e}();exports.WebSocketApi=f;
114
114
  },{"ws":"p58b"}],"TPH7":[function(require,module,exports) {
115
115
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.wss_url=exports.server_url=exports.port=exports.file_server_url=exports.automation_modules_path=exports.async_modules_path=void 0;var e="https://gudhub.com/GudHub_Test";exports.server_url=e;var s="wss://gudhub.com/GudHub/ws/app/";exports.wss_url=s;var r="build/latest/async_modules/";exports.async_modules_path=r;var t="build/latest/automation_modules/";exports.automation_modules_path=t;var o="https://gudhub.com";exports.file_server_url=o;var u=9e3;exports.port=u;
116
116
  },{}],"DvAj":[function(require,module,exports) {
@@ -193,7 +193,7 @@ var t,e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),expo
193
193
  },{"axios":"O4Aa","./../consts.js":"UV2u"}],"Htuh":[function(require,module,exports) {
194
194
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GHConstructor=void 0;var t=r(require("./createAngularModuleInstance.js")),e=r(require("./createClassInstance.js"));function r(t){return t&&t.__esModule?t:{default:t}}function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){o=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(I){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof d?e:d,a=Object.create(o.prototype),u=new O(n||[]);return i(a,"_invoke",{value:j(t,r,u)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(I){return{type:"throw",arg:I}}}t.wrap=f;var p={};function d(){}function v(){}function y(){}var g={};l(g,u,function(){return this});var m=Object.getPrototypeOf,b=m&&m(m(S([])));b&&b!==e&&r.call(b,u)&&(g=b);var w=y.prototype=d.prototype=Object.create(g);function x(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function L(t,e){var o;i(this,"_invoke",{value:function(i,a){function u(){return new e(function(o,u){!function o(i,a,u,c){var s=h(t[i],t,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==n(f)&&r.call(f,"__await")?e.resolve(f.__await).then(function(t){o("next",t,u,c)},function(t){o("throw",t,u,c)}):e.resolve(f).then(function(t){l.value=t,u(l)},function(t){return o("throw",t,u,c)})}c(s.arg)}(i,a,o,u)})}return o=o?o.then(u,u):u()}})}function j(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===p)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=h(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=h(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,p;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return v.prototype=y,i(w,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:v,configurable:!0}),v.displayName=l(y,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,l(t,s,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},x(L.prototype),l(L.prototype,c,function(){return this}),t.AsyncIterator=L,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new L(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},x(w),l(w,s,"Generator"),l(w,u,function(){return this}),l(w,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=S,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function i(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(s){return void r(s)}u.done?e(c):Promise.resolve(c).then(n,o)}function a(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function u(t){i(a,n,o,u,c,"next",t)}function c(t){i(a,n,o,u,c,"throw",t)}u(void 0)})}}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,l(n.key),n)}}function s(t,e,r){return e&&c(t.prototype,e),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t){var e=f(t,"string");return"symbol"===n(e)?e:String(e)}function f(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var h=function(){function r(t){u(this,r),this.gudhub=t,this.cache={},this.modulesQueue={},this.angularInjector,this.nodeWindow}return s(r,[{key:"getInstance",value:function(){var t=a(o().mark(function t(e){return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.getCached(e)){t.next=4;break}return t.abrupt("return",this.getCached(e));case 4:if(!this.modulesQueue[e]){t.next=9;break}return t.next=7,this.modulesQueue[e];case 7:t.next=12;break;case 9:return this.modulesQueue[e]=this.createInstance(e),t.next=12,this.modulesQueue[e];case 12:return t.abrupt("return",this.getCached(e));case 13:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"pupToCache",value:function(t,e){this.cache[t]=e}},{key:"getCached",value:function(t){return this.cache[t]}},{key:"initAngularInjector",value:function(t){this.angularInjector=t}},{key:"initJsdomWindow",value:function(t){this.nodeWindow=t}},{key:"createInstance",value:function(){var r=a(o().mark(function r(n){var i,a;return o().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(i=this.gudhub.storage.getModuleUrl(n)){r.next=4;break}return console.log("Cannot find module: ".concat(n)),r.abrupt("return");case 4:if("gh_element"!==i.type){r.next=15;break}if("angular"!==i.technology){r.next=11;break}return r.next=8,(0,t.default)(this.gudhub,n,i.url,this.angularInjector,this.nodeWindow);case 8:a=r.sent,r.next=15;break;case 11:if("class"!==i.technology){r.next=15;break}return r.next=14,(0,e.default)(this.gudhub,n,i.js,i.css,this.nodeWindow);case 14:a=r.sent;case 15:return a&&this.pupToCache(n,a),r.abrupt("return",a);case 17:case"end":return r.stop()}},r,this)}));return function(t){return r.apply(this,arguments)}}()}]),r}();exports.GHConstructor=h;
195
195
  },{"./createAngularModuleInstance.js":"osSN","./createClassInstance.js":"DsUm"}],"q0my":[function(require,module,exports) {
196
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AppProcessor=void 0;var t=require("../consts.js");function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){return a(t)||i(t)||c(t)||n()}function n(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function a(t){if(Array.isArray(t))return f(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){s(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function s(t,e,r){return(e=_(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function u(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=c(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,p=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){p=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(p)throw a}}}}function c(t,e){if(t){if("string"==typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(t,e):void 0}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function l(){l=function(){return t};var t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",p=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(P){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var a=e&&e.prototype instanceof v?e:v,o=Object.create(a.prototype),p=new j(n||[]);return i(o,"_invoke",{value:x(t,r,p)}),o}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(P){return{type:"throw",arg:P}}}t.wrap=c;var h={};function v(){}function d(){}function g(){}var m={};u(m,o,function(){return this});var _=Object.getPrototypeOf,y=_&&_(_(O([])));y&&y!==r&&n.call(y,o)&&(m=y);var w=g.prototype=v.prototype=Object.create(m);function b(t){["next","throw","return"].forEach(function(e){u(t,e,function(t){return this._invoke(e,t)})})}function A(t,r){var a;i(this,"_invoke",{value:function(i,o){function p(){return new r(function(a,p){!function i(a,o,p,s){var u=f(t[a],t,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==e(l)&&n.call(l,"__await")?r.resolve(l.__await).then(function(t){i("next",t,p,s)},function(t){i("throw",t,p,s)}):r.resolve(l).then(function(t){c.value=t,p(c)},function(t){return i("throw",t,p,s)})}s(u.arg)}(i,o,a,p)})}return a=a?a.then(p,p):p()}})}function x(t,e,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return E()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var p=k(o,r);if(p){if(p===h)continue;return p}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=f(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=f(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,h;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:E}}function E(){return{value:void 0,done:!0}}return d.prototype=g,i(w,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:d,configurable:!0}),d.displayName=u(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,s,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},b(A.prototype),u(A.prototype,p,function(){return this}),t.AsyncIterator=A,t.async=function(e,r,n,i,a){void 0===a&&(a=Promise);var o=new A(c(e,r,n,i),a);return t.isGeneratorFunction(r)?o:o.next().then(function(t){return t.done?t.value:o.next()})},b(w),u(w,s,"Generator"),u(w,o,function(){return this}),u(w,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return o.type="throw",o.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var p=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(p&&s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(p){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function h(t,e,r,n,i,a,o){try{var p=t[a](o),s=p.value}catch(u){return void r(u)}p.done?e(s):Promise.resolve(s).then(n,i)}function v(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var a=t.apply(e,r);function o(t){h(a,n,i,o,p,"next",t)}function p(t){h(a,n,i,o,p,"throw",t)}o(void 0)})}}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_(n.key),n)}}function m(t,e,r){return e&&g(t.prototype,e),r&&g(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _(t){var r=y(t,"string");return"symbol"===e(r)?r:String(r)}function y(t,r){if("object"!==e(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,r||"default");if("object"!==e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var w=function(){function e(t,r,n,i,a,o,p){d(this,e),this.storage=t,this.pipeService=r,this.req=n,this.ws=i,this.applistReceived=!1,this.activateSW=p,this.chunksManager=a,this.util=o,this.appListeners()}return m(e,[{key:"createNewAppApi",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.post({url:"/api/app/create",form:{app:JSON.stringify(e)}});case 3:return(r=t.sent).from_apps_list=!0,t.abrupt("return",r);case 8:return t.prev=8,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 12:case"end":return t.stop()}},t,this,[[0,8]])}));return function(e){return t.apply(this,arguments)}}()},{key:"updateAppApi",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.post({url:"/api/app/update",form:{app:JSON.stringify(e)}});case 3:return r=t.sent,t.abrupt("return",r);case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e){return t.apply(this,arguments)}}()},{key:"deleteAppApi",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.post({url:"/api/app/delete",form:{app_id:e}});case 3:return r=t.sent,t.abrupt("return",r);case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e){return t.apply(this,arguments)}}()},{key:"getAppListApi",value:function(){var t=v(l().mark(function t(){var e;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.get({url:"/api/applist/get"});case 3:return e=t.sent,t.abrupt("return",e.apps_list.map(function(t){return t.from_apps_list=!0,t}));case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(){return t.apply(this,arguments)}}()},{key:"getAppApi",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.get({url:"/api/app/get",params:{app_id:e}});case 3:return r=t.sent,t.abrupt("return",r);case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e){return t.apply(this,arguments)}}()},{key:"getAppListFromStorage",value:function(){return this.storage.getAppsList()}},{key:"getAppFromStorage",value:function(t){var e=this.storage.getApp(t);return e&&e.field_list.length?e:null}},{key:"addNewAppToStorage",value:function(t){return this.storage.getAppsList().push(t)}},{key:"saveAppInStorage",value:function(t){t.items_object={};for(var e=0;e<t.items_list.length;e++){t.items_object[t.items_list[e].item_id]={};for(var r=0;r<t.items_list[e].fields.length;r++)t.items_object[t.items_list[e].item_id][t.items_list[e].fields[r].field_id]=t.items_list[e].fields[r]}var n=this.storage.getApp(t.app_id);return n?(t.from_apps_list=n.from_apps_list,t.permission=n.permission,this.storage.updateApp(t)):(t.from_apps_list=!1,this.addNewAppToStorage(t)),this.getAppFromStorage(t.app_id)}},{key:"updatingAppInStorage",value:function(t){var e=this,r=this.getAppFromStorage(t.app_id);t.items_list=r.items_list,t.file_list=r.file_list,t.from_apps_list=r.from_apps_list,t.items_object=r.items_object,this.storage.updateApp(t),this.pipeService.emit("gh_app_views_update",{app_id:t.app_id},t.views_list),t.field_list.forEach(function(r){e.pipeService.emit("gh_model_update",{app_id:t.app_id,field_id:r.field_id},r)})}},{key:"deletingAppFromStorage",value:function(t){var e=this.storage.getAppsList();return e.forEach(function(r,n){r.app_id==t&&e.splice(n)}),e}},{key:"updateAppsListInStorage",value:function(){var t,e=u(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]);try{for(e.s();!(t=e.n()).done;){var r=t.value,n=this.storage.getApp(r.app_id);n?(n.from_apps_list=r.from_apps_list,n.permission=r.permission):this.addNewAppToStorage(r)}}catch(i){e.e(i)}finally{e.f()}}},{key:"refreshApps",value:function(){var t=v(l().mark(function t(){var e,r,n,i,a,o,p,s=arguments;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=s.length>0&&void 0!==s[0]?s[0]:[],r=u(e),t.prev=2,r.s();case 4:if((n=r.n()).done){t.next=19;break}if(null==(i=n.value)||!this.storage.getApp(i)){t.next=17;break}return t.prev=7,t.next=10,this.getAppApi(i);case 10:if(a=t.sent){for(a.items_object={},o=0;o<a.items_list.length;o++)for(a.items_object[a.items_list[o].item_id]={},p=0;p<a.items_list[o].fields.length;p++)a.items_object[a.items_list[o].item_id][a.items_list[o].fields[p].field_id]=a.items_list[o].fields[p];this.storage.updateApp(a)}t.next=17;break;case 14:t.prev=14,t.t0=t.catch(7),console.log(t.t0);case 17:t.next=4;break;case 19:t.next=24;break;case 21:t.prev=21,t.t1=t.catch(2),r.e(t.t1);case 24:return t.prev=24,r.f(),t.finish(24);case 27:console.log("Apps refreshed: ",JSON.stringify(e));case 28:case"end":return t.stop()}},t,this,[[2,21,24,27],[7,14]])}));return function(){return t.apply(this,arguments)}}()},{key:"refreshAppsList",value:function(){var t=v(l().mark(function t(){var e,r,n;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getAppListFromStorage(),t.next=3,this.getAppListApi();case 3:r=t.sent,n=r.map(function(t){return p(p({},t),e.find(function(e){return e.app_id===t.app_id}))}),this.updateAppsListInStorage(n),this.pipeService.emit("gh_apps_list_refreshed",{});case 7:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"getAppsList",value:function(){var t=v(l().mark(function t(){var e,r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.getAppListFromStorage(),this.applistReceived){t.next=10;break}return t.next=4,this.getAppListApi();case 4:if(r=t.sent){t.next=7;break}return t.abrupt("return",null);case 7:this.updateAppsListInStorage(r),this.applistReceived=!0,e=r;case 10:return t.abrupt("return",e);case 11:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"getAppInfo",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getAppsList();case 2:return r=t.sent,t.abrupt("return",r?r.find(function(t){return t.app_id==e}):null);case 4:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"deleteApp",value:function(){var t=v(l().mark(function t(e){return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.deleteAppApi(e);case 2:return t.abrupt("return",this.deletingAppFromStorage(e));case 3:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"getApp",value:function(){var t=v(l().mark(function t(e){var n,i,a=this,o=arguments;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o.length>1&&void 0!==o[1]&&o[1],e){t.next=3;break}return t.abrupt("return",null);case 3:if(n=this.getAppFromStorage(e)){t.next=11;break}return t.next=7,this.getAppApi(e);case 7:if(i=t.sent){t.next=10;break}return t.abrupt("return",null);case 10:i.chunks&&i.chunks.length?(this.chunksManager.getChunks(e,i.chunks).then(function(t){i.items_list=a.util.mergeChunks([].concat(r(t),[i])),a.saveAppInStorage(i),a.pipeService.emit("gh_items_update",{app_id:e},i.items_list)}),n=i,this.saveAppInStorage(i)):(n=this.getAppFromStorage(e))||(n=i,this.saveAppInStorage(i),this.ws.addSubscription(e));case 11:return t.abrupt("return",n);case 12:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"updateApp",value:function(){var t=v(l().mark(function t(e){var r,n;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.views_list&&e.views_list.length&&e.show){t.next=6;break}return t.next=3,this.getApp(e.app_id);case 3:r=t.sent,e.views_list&&e.views_list.length||(e.views_list=r.views_list),void 0===e.show&&(e.show=r.show);case 6:return t.next=8,this.updateAppApi(e);case 8:return n=t.sent,this.updatingAppInStorage(n),t.abrupt("return",n);case 11:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"updateAppInfo",value:function(){var t=v(l().mark(function t(){var e,r=arguments;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},this.pipeService.emit("gh_app_info_update",{app_id:e.app_id},e),t.abrupt("return",this.updateApp(e));case 3:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"createNewApp",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.createNewAppApi(e);case 2:return(r=t.sent).items_object={},this.addNewAppToStorage(r),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"getAppViews",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=5;break}return t.next=3,this.getApp(e);case 3:return r=t.sent,t.abrupt("return",r.views_list);case 5:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"clearAppProcessor",value:function(){this.getAppListPromises=null,this.getAppPromises={},this.applistReceived=!1}},{key:"appListeners",value:function(){var e=this;this.pipeService.onRoot("gh_app_get",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n||!n.app_id){t.next=5;break}return t.next=3,e.getApp(n.app_id);case 3:i=t.sent,e.pipeService.emit("gh_app_get",n,i);case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_apps_list_get",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getAppsList();case 2:i=t.sent,e.pipeService.emit("gh_apps_list_get",n,i);case 4:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_delete_app",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.deleteApp(n.app_id);case 2:i=t.sent,e.pipeService.emit("gh_apps_list_update",{recipient:"all"},i);case 4:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_update",{},function(){var t=v(l().mark(function t(r,n){var i,a;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n.app.items_list=[],n.app.file_list=[],t.next=4,e.updateApp(n.app);case 4:return i=t.sent,e.pipeService.emit("gh_app_views_update",{app_id:i.app_id},i.views_list),t.next=8,e.getAppsList();case 8:a=t.sent,e.pipeService.emit("gh_apps_list_update",{recipient:"all"},a),i.field_list.forEach(function(t){e.pipeService.emit("gh_model_update",{app_id:i.app_id,field_id:t.field_id},t)});case 11:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_view_get",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n||!n.app_id){t.next=5;break}return t.next=3,e.getApp(n.app_id);case 3:(i=t.sent).views_list.forEach(function(t,r){t.view_id==n.view_id&&e.pipeService.emit("gh_app_view_get",n,i.views_list[r])});case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_info_get",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getAppInfo(n.app_id);case 2:(i=t.sent)&&e.pipeService.emit("gh_app_info_get",n,i);case 4:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_info_update",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n||!n.app){t.next=5;break}return t.next=3,e.updateAppInfo(n.app);case 3:i=t.sent,e.pipeService.emit("gh_app_info_update",{app_id:n.app.app_id},i);case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_create",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.createNewApp(n.app);case 2:return t.next=4,e.getAppsList();case 4:i=t.sent,e.pipeService.emit("gh_apps_list_update",{recipient:"all"},i);case 6:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),t.IS_WEB&&this.activateSW&&navigator.serviceWorker.addEventListener("message",function(){var t=v(l().mark(function t(r){var n;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("refresh app"!==r.data.type){t.next=7;break}return t.next=3,e.getApp(r.data.payload.app_id);case 3:(n=t.sent)&&e.util.compareAppsItemsLists(n.items_list,r.data.payload.items_list.filter(function(t){return!t.trash}),function(t){var n=t.diff_fields_items,i=t.diff_fields_items_Ids,a=t.diff_items,o=t.newItems,p=t.deletedItems;(a.length||o.length||p.length)&&(e.pipeService.emit("gh_items_update",{app_id:r.data.payload.app_id},r.data.payload.items_list.filter(function(t){return!t.trash})),a.forEach(function(t){return e.pipeService.emit("gh_item_update",{app_id:r.data.payload.app_id,item_id:t.item_id},t)})),i.forEach(function(t){var i=n[t];i&&i.forEach(function(n){e.pipeService.emit("gh_value_update",{app_id:r.data.payload.app_id,item_id:t,field_id:n.field_id},n.field_value)})})}),r.data.payload.items_list=e.util.mergeChunks([n,r.data.payload]),e.saveAppInStorage(r.data.payload);case 7:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}}]),e}();exports.AppProcessor=w;
196
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AppProcessor=void 0;var t=require("../consts.js");function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){return a(t)||i(t)||c(t)||n()}function n(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function a(t){if(Array.isArray(t))return f(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){s(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function s(t,e,r){return(e=_(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function u(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=c(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,p=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){p=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(p)throw a}}}}function c(t,e){if(t){if("string"==typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(t,e):void 0}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function l(){l=function(){return t};var t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",p=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(I){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var a=e&&e.prototype instanceof v?e:v,o=Object.create(a.prototype),p=new j(n||[]);return i(o,"_invoke",{value:x(t,r,p)}),o}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(I){return{type:"throw",arg:I}}}t.wrap=c;var h={};function v(){}function d(){}function g(){}var m={};u(m,o,function(){return this});var _=Object.getPrototypeOf,y=_&&_(_(O([])));y&&y!==r&&n.call(y,o)&&(m=y);var w=g.prototype=v.prototype=Object.create(m);function b(t){["next","throw","return"].forEach(function(e){u(t,e,function(t){return this._invoke(e,t)})})}function A(t,r){var a;i(this,"_invoke",{value:function(i,o){function p(){return new r(function(a,p){!function i(a,o,p,s){var u=f(t[a],t,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==e(l)&&n.call(l,"__await")?r.resolve(l.__await).then(function(t){i("next",t,p,s)},function(t){i("throw",t,p,s)}):r.resolve(l).then(function(t){c.value=t,p(c)},function(t){return i("throw",t,p,s)})}s(u.arg)}(i,o,a,p)})}return a=a?a.then(p,p):p()}})}function x(t,e,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return E()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var p=S(o,r);if(p){if(p===h)continue;return p}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=f(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=f(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,h;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:E}}function E(){return{value:void 0,done:!0}}return d.prototype=g,i(w,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:d,configurable:!0}),d.displayName=u(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,s,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},b(A.prototype),u(A.prototype,p,function(){return this}),t.AsyncIterator=A,t.async=function(e,r,n,i,a){void 0===a&&(a=Promise);var o=new A(c(e,r,n,i),a);return t.isGeneratorFunction(r)?o:o.next().then(function(t){return t.done?t.value:o.next()})},b(w),u(w,s,"Generator"),u(w,o,function(){return this}),u(w,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return o.type="throw",o.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var p=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(p&&s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(p){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function h(t,e,r,n,i,a,o){try{var p=t[a](o),s=p.value}catch(u){return void r(u)}p.done?e(s):Promise.resolve(s).then(n,i)}function v(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var a=t.apply(e,r);function o(t){h(a,n,i,o,p,"next",t)}function p(t){h(a,n,i,o,p,"throw",t)}o(void 0)})}}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_(n.key),n)}}function m(t,e,r){return e&&g(t.prototype,e),r&&g(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _(t){var r=y(t,"string");return"symbol"===e(r)?r:String(r)}function y(t,r){if("object"!==e(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,r||"default");if("object"!==e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var w=function(){function e(t,r,n,i,a,o,p){d(this,e),this.storage=t,this.pipeService=r,this.req=n,this.ws=i,this.applistReceived=!1,this.activateSW=p,this.chunksManager=a,this.util=o,this.appListeners()}return m(e,[{key:"createNewAppApi",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.post({url:"/api/app/create",form:{app:JSON.stringify(e)}});case 3:return(r=t.sent).from_apps_list=!0,t.abrupt("return",r);case 8:return t.prev=8,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 12:case"end":return t.stop()}},t,this,[[0,8]])}));return function(e){return t.apply(this,arguments)}}()},{key:"updateAppApi",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.post({url:"/api/app/update",form:{app:JSON.stringify(e)}});case 3:return r=t.sent,t.abrupt("return",r);case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e){return t.apply(this,arguments)}}()},{key:"deleteAppApi",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.post({url:"/api/app/delete",form:{app_id:e}});case 3:return r=t.sent,t.abrupt("return",r);case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e){return t.apply(this,arguments)}}()},{key:"getAppListApi",value:function(){var t=v(l().mark(function t(){var e;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.get({url:"/api/applist/get"});case 3:return e=t.sent,t.abrupt("return",e.apps_list.map(function(t){return t.from_apps_list=!0,t}));case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(){return t.apply(this,arguments)}}()},{key:"getAppApi",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.get({url:"/api/app/get",params:{app_id:e}});case 3:return r=t.sent,t.abrupt("return",r);case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e){return t.apply(this,arguments)}}()},{key:"getAppListFromStorage",value:function(){return this.storage.getAppsList()}},{key:"getAppFromStorage",value:function(t){var e=this.storage.getApp(t);return e&&e.field_list.length?e:null}},{key:"addNewAppToStorage",value:function(t){return this.storage.getAppsList().push(t)}},{key:"saveAppInStorage",value:function(t){t.items_object={};for(var e=0;e<t.items_list.length;e++){t.items_object[t.items_list[e].item_id]={};for(var r=0;r<t.items_list[e].fields.length;r++)t.items_object[t.items_list[e].item_id][t.items_list[e].fields[r].field_id]=t.items_list[e].fields[r]}var n=this.storage.getApp(t.app_id);return n?(t.from_apps_list=n.from_apps_list,t.permission=n.permission,this.storage.updateApp(t)):(t.from_apps_list=!1,this.addNewAppToStorage(t)),this.getAppFromStorage(t.app_id)}},{key:"updatingAppInStorage",value:function(t){var e=this,r=this.getAppFromStorage(t.app_id);t.items_list=r.items_list,t.file_list=r.file_list,t.from_apps_list=r.from_apps_list,t.items_object=r.items_object,this.storage.updateApp(t),this.pipeService.emit("gh_app_views_update",{app_id:t.app_id},t.views_list),t.field_list.forEach(function(r){e.pipeService.emit("gh_model_update",{app_id:t.app_id,field_id:r.field_id},r)})}},{key:"deletingAppFromStorage",value:function(t){var e=this.storage.getAppsList();return e.forEach(function(r,n){r.app_id==t&&e.splice(n)}),e}},{key:"updateAppsListInStorage",value:function(){var t,e=u(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]);try{for(e.s();!(t=e.n()).done;){var r=t.value,n=this.storage.getApp(r.app_id);n?(n.from_apps_list=r.from_apps_list,n.permission=r.permission):this.addNewAppToStorage(r)}}catch(i){e.e(i)}finally{e.f()}}},{key:"refreshApps",value:function(){var t=v(l().mark(function t(){var e,r,n,i,a,o,p,s=arguments;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=s.length>0&&void 0!==s[0]?s[0]:[],r=u(e),t.prev=2,r.s();case 4:if((n=r.n()).done){t.next=19;break}if(null==(i=n.value)){t.next=17;break}return t.prev=7,t.next=10,this.getAppApi(i);case 10:if(a=t.sent){for(a.items_object={},o=0;o<a.items_list.length;o++)for(a.items_object[a.items_list[o].item_id]={},p=0;p<a.items_list[o].fields.length;p++)a.items_object[a.items_list[o].item_id][a.items_list[o].fields[p].field_id]=a.items_list[o].fields[p];this.updatingAppInStorage(a)}t.next=17;break;case 14:t.prev=14,t.t0=t.catch(7),console.log(t.t0);case 17:t.next=4;break;case 19:t.next=24;break;case 21:t.prev=21,t.t1=t.catch(2),r.e(t.t1);case 24:return t.prev=24,r.f(),t.finish(24);case 27:console.log("Apps refreshed: ",JSON.stringify(e));case 28:case"end":return t.stop()}},t,this,[[2,21,24,27],[7,14]])}));return function(){return t.apply(this,arguments)}}()},{key:"refreshAppsList",value:function(){var t=v(l().mark(function t(){var e,r,n;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getAppListFromStorage(),t.next=3,this.getAppListApi();case 3:r=t.sent,n=r.map(function(t){return p(p({},t),e.find(function(e){return e.app_id===t.app_id}))}),this.updateAppsListInStorage(n),this.pipeService.emit("gh_apps_list_refreshed",{});case 7:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"getAppsList",value:function(){var t=v(l().mark(function t(){var e,r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.getAppListFromStorage(),this.applistReceived){t.next=10;break}return t.next=4,this.getAppListApi();case 4:if(r=t.sent){t.next=7;break}return t.abrupt("return",null);case 7:this.updateAppsListInStorage(r),this.applistReceived=!0,e=r;case 10:return t.abrupt("return",e);case 11:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"getAppInfo",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getAppsList();case 2:return r=t.sent,t.abrupt("return",r?r.find(function(t){return t.app_id==e}):null);case 4:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"deleteApp",value:function(){var t=v(l().mark(function t(e){return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.deleteAppApi(e);case 2:return t.abrupt("return",this.deletingAppFromStorage(e));case 3:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"getApp",value:function(){var t=v(l().mark(function t(e){var n,i,a=this,o=arguments;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o.length>1&&void 0!==o[1]&&o[1],e){t.next=3;break}return t.abrupt("return",null);case 3:if(n=this.getAppFromStorage(e)){t.next=11;break}return t.next=7,this.getAppApi(e);case 7:if(i=t.sent){t.next=10;break}return t.abrupt("return",null);case 10:i.chunks&&i.chunks.length?(this.chunksManager.getChunks(e,i.chunks).then(function(t){i.items_list=a.util.mergeChunks([].concat(r(t),[i])),a.saveAppInStorage(i),a.pipeService.emit("gh_items_update",{app_id:e},i.items_list)}),n=i,this.saveAppInStorage(i)):(n=this.getAppFromStorage(e))||(n=i,this.saveAppInStorage(i),this.ws.addSubscription(e));case 11:return t.abrupt("return",n);case 12:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"updateApp",value:function(){var t=v(l().mark(function t(e){var r,n;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.views_list&&e.views_list.length&&e.show){t.next=6;break}return t.next=3,this.getApp(e.app_id);case 3:r=t.sent,e.views_list&&e.views_list.length||(e.views_list=r.views_list),void 0===e.show&&(e.show=r.show);case 6:return t.next=8,this.updateAppApi(e);case 8:return n=t.sent,this.updatingAppInStorage(n),t.abrupt("return",n);case 11:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"updateAppInfo",value:function(){var t=v(l().mark(function t(){var e,r=arguments;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},this.pipeService.emit("gh_app_info_update",{app_id:e.app_id},e),t.abrupt("return",this.updateApp(e));case 3:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"createNewApp",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.createNewAppApi(e);case 2:return(r=t.sent).items_object={},this.addNewAppToStorage(r),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"getAppViews",value:function(){var t=v(l().mark(function t(e){var r;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=5;break}return t.next=3,this.getApp(e);case 3:return r=t.sent,t.abrupt("return",r.views_list);case 5:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"clearAppProcessor",value:function(){this.getAppListPromises=null,this.getAppPromises={},this.applistReceived=!1}},{key:"appListeners",value:function(){var e=this;this.pipeService.onRoot("gh_app_get",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n||!n.app_id){t.next=5;break}return t.next=3,e.getApp(n.app_id);case 3:i=t.sent,e.pipeService.emit("gh_app_get",n,i);case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_apps_list_get",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getAppsList();case 2:i=t.sent,e.pipeService.emit("gh_apps_list_get",n,i);case 4:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_delete_app",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.deleteApp(n.app_id);case 2:i=t.sent,e.pipeService.emit("gh_apps_list_update",{recipient:"all"},i);case 4:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_update",{},function(){var t=v(l().mark(function t(r,n){var i,a;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n.app.items_list=[],n.app.file_list=[],t.next=4,e.updateApp(n.app);case 4:return i=t.sent,e.pipeService.emit("gh_app_views_update",{app_id:i.app_id},i.views_list),t.next=8,e.getAppsList();case 8:a=t.sent,e.pipeService.emit("gh_apps_list_update",{recipient:"all"},a),i.field_list.forEach(function(t){e.pipeService.emit("gh_model_update",{app_id:i.app_id,field_id:t.field_id},t)});case 11:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_view_get",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n||!n.app_id){t.next=5;break}return t.next=3,e.getApp(n.app_id);case 3:(i=t.sent).views_list.forEach(function(t,r){t.view_id==n.view_id&&e.pipeService.emit("gh_app_view_get",n,i.views_list[r])});case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_info_get",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getAppInfo(n.app_id);case 2:(i=t.sent)&&e.pipeService.emit("gh_app_info_get",n,i);case 4:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_info_update",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n||!n.app){t.next=5;break}return t.next=3,e.updateAppInfo(n.app);case 3:i=t.sent,e.pipeService.emit("gh_app_info_update",{app_id:n.app.app_id},i);case 5:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),this.pipeService.onRoot("gh_app_create",{},function(){var t=v(l().mark(function t(r,n){var i;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.createNewApp(n.app);case 2:return t.next=4,e.getAppsList();case 4:i=t.sent,e.pipeService.emit("gh_apps_list_update",{recipient:"all"},i);case 6:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()),t.IS_WEB&&this.activateSW&&navigator.serviceWorker.addEventListener("message",function(){var t=v(l().mark(function t(r){var n;return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("refresh app"!==r.data.type){t.next=7;break}return t.next=3,e.getApp(r.data.payload.app_id);case 3:(n=t.sent)&&e.util.compareAppsItemsLists(n.items_list,r.data.payload.items_list.filter(function(t){return!t.trash}),function(t){var n=t.diff_fields_items,i=t.diff_fields_items_Ids,a=t.diff_items,o=t.newItems,p=t.deletedItems;(a.length||o.length||p.length)&&(e.pipeService.emit("gh_items_update",{app_id:r.data.payload.app_id},r.data.payload.items_list.filter(function(t){return!t.trash})),a.forEach(function(t){return e.pipeService.emit("gh_item_update",{app_id:r.data.payload.app_id,item_id:t.item_id},t)})),i.forEach(function(t){var i=n[t];i&&i.forEach(function(n){e.pipeService.emit("gh_value_update",{app_id:r.data.payload.app_id,item_id:t,field_id:n.field_id},n.field_value)})})}),r.data.payload.items_list=e.util.mergeChunks([n,r.data.payload]),e.saveAppInStorage(r.data.payload);case 7:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}}]),e}();exports.AppProcessor=w;
197
197
  },{"../consts.js":"UV2u"}],"UUd3":[function(require,module,exports) {
198
198
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ItemProcessor=void 0;var t=require("../utils.js");function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function n(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach(function(e){i(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function i(t,e,r){return(e=f(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(){o=function(){return t};var t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function p(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(E){p=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof d?e:d,a=Object.create(o.prototype),u=new I(n||[]);return i(a,"_invoke",{value:S(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(E){return{type:"throw",arg:E}}}t.wrap=f;var h={};function d(){}function v(){}function m(){}var y={};p(y,u,function(){return this});var _=Object.getPrototypeOf,g=_&&_(_(L([])));g&&g!==r&&n.call(g,u)&&(y=g);var w=m.prototype=d.prototype=Object.create(y);function b(t){["next","throw","return"].forEach(function(e){p(t,e,function(t){return this._invoke(e,t)})})}function x(t,r){var o;i(this,"_invoke",{value:function(i,a){function u(){return new r(function(o,u){!function i(o,a,u,s){var c=l(t[o],t,a);if("throw"!==c.type){var p=c.arg,f=p.value;return f&&"object"==e(f)&&n.call(f,"__await")?r.resolve(f.__await).then(function(t){i("next",t,u,s)},function(t){i("throw",t,u,s)}):r.resolve(f).then(function(t){p.value=t,u(p)},function(t){return i("throw",t,u,s)})}s(c.arg)}(i,a,o,u)})}return o=o?o.then(u,u):u()}})}function S(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return P()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===h)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=l(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,h;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function L(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:P}}function P(){return{value:void 0,done:!0}}return v.prototype=m,i(w,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:v,configurable:!0}),v.displayName=p(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,p(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},b(x.prototype),p(x.prototype,s,function(){return this}),t.AsyncIterator=x,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new x(f(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},b(w),p(w,c,"Generator"),p(w,u,function(){return this}),p(w,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=L,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(j),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;j(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function a(t,e,r,n,i,o,a){try{var u=t[o](a),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,i)}function u(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function u(t){a(o,n,i,u,s,"next",t)}function s(t){a(o,n,i,u,s,"throw",t)}u(void 0)})}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}}function p(t,e,r){return e&&c(t.prototype,e),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t){var r=l(t,"string");return"symbol"===e(r)?r:String(r)}function l(t,r){if("object"!==e(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,r||"default");if("object"!==e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var h=function(){function e(t,r,n,i,o){s(this,e),this.storage=t,this.pipeService=r,this.req=n,this.appProcessor=i,this.util=o,this.itemListeners()}return p(e,[{key:"addItemsApi",value:function(){var t=u(o().mark(function t(e,r){var n;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.post({url:"/api/items/add",form:{items:JSON.stringify(r),app_id:e}});case 3:return n=t.sent,t.abrupt("return",n);case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e,r){return t.apply(this,arguments)}}()},{key:"updateItemsApi",value:function(){var t=u(o().mark(function t(e,r){var n;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.req.post({url:"/api/items/update",form:{items:JSON.stringify(r),app_id:e}});case 3:return n=t.sent,t.abrupt("return",n);case 7:return t.prev=7,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e,r){return t.apply(this,arguments)}}()},{key:"deleteItemsApi",value:function(t){try{var e=this.req.post({url:"/api/items/delete",form:{items_ids:JSON.stringify(t)}});return e.from_apps_list=!0,e}catch(r){return console.log(r),null}}},{key:"addItemsToStorage",value:function(){var t=u(o().mark(function t(e,r){var n,i=this;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.appProcessor.getApp(e);case 2:return(n=t.sent)&&(r.forEach(function(t){n.items_list.push(t),n.items_object[t.item_id]={};for(var r=0;r<t.fields.length;r++)n.items_object[t.item_id][t.fields[r].field_id]=t.fields[r];i.pipeService.emit("gh_item_update",{app_id:e},[t])}),this.pipeService.emit("gh_items_update",{app_id:e},n.items_list),this.storage.updateApp(n)),t.abrupt("return",n);case 5:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"updateItemsInStorage",value:function(){var t=u(o().mark(function t(e,r){var n,i=this;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.pipeService.emit("gh_items_update",{app_id:e},r),t.next=3,this.appProcessor.getApp(e);case 3:return(n=t.sent)&&r&&r.forEach(function(t){var r={app_id:e};i.pipeService.emit("gh_item_update",r,[t]),r.item_id=t.item_id,i.pipeService.emit("gh_item_update",r,t);var o=n.items_list.find(function(e){return e.item_id==t.item_id});o&&t.fields.forEach(function(t){var e=o.fields.find(function(e){return e.field_id==t.field_id});r.field_id=t.field_id,e?e.field_value!=t.field_value&&(e.field_value=t.field_value,n.items_object[o.item_id][e.field_id]=e,i.pipeService.emit("gh_value_update",r,t.field_value)):(o.fields.push(t),n.items_object[o.item_id][t.field_id]=t,i.pipeService.emit("gh_value_update",r,t.field_value))})}),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"deleteItemsFromStorage",value:function(){var t=u(o().mark(function t(e){var r,n,i=arguments;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:[],t.next=3,this.appProcessor.getApp(e);case 3:(n=t.sent)&&(n.items_list=n.items_list.filter(function(t){return!r.find(function(e){return t.item_id==e.item_id})||(delete n.items_object[t.item_id],!1)}),this.pipeService.emit("gh_items_update",{app_id:e},n.items_list),this.storage.updateApp(n));case 5:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"getItems",value:function(){var t=u(o().mark(function t(e){var r,n,i=arguments;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>1&&void 0!==i[1]&&i[1],t.next=3,this.appProcessor.getApp(e,r);case 3:if(n=t.sent){t.next=6;break}return t.abrupt("return",null);case 6:return t.abrupt("return",n.items_list);case 7:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"addNewItems",value:function(){var e=u(o().mark(function e(r,i){var a,u;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=i.map(function(e){return n(n({},e),{},{fields:(0,t.filterFields)(e.fields)})}),e.next=3,this.addItemsApi(r,a);case 3:return u=e.sent,e.next=6,this.addItemsToStorage(r,u);case 6:return this.pipeService.emit("gh_items_add",{app_id:r},u),e.abrupt("return",u);case 8:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"updateItems",value:function(){var e=u(o().mark(function e(r,i){var a,u;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=i.map(function(e){return n(n({},e),{},{fields:(0,t.filterFields)(e.fields)})}),e.next=3,this.updateItemsApi(r,a);case 3:return u=e.sent,e.next=6,this.updateItemsInStorage(r,u);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"deleteItems",value:function(){var t=u(o().mark(function t(e,r){var n=this;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.deleteItemsApi(r).then(function(){var t=u(o().mark(function t(r){return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.deleteItemsFromStorage(e,r);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"itemListeners",value:function(){var t=this;this.pipeService.onRoot("gh_items_get",{},function(){var e=u(o().mark(function e(r,n){var i;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!n||!n.app_id){e.next=5;break}return e.next=3,t.getItems(n.app_id);case 3:(i=e.sent)?t.pipeService.emit("gh_items_get",n,i):t.pipeService.emit("gh_items_get",n,[]);case 5:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()),this.pipeService.onRoot("gh_items_add",{},function(){var e=u(o().mark(function e(r,n){var i;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n&&n.app_id&&n.items)){e.next=5;break}return e.next=3,t.addNewItems(n.app_id,n.items);case 3:(i=e.sent)?t.pipeService.emit("gh_items_add",n,i):t.pipeService.emit("gh_items_add",n,[]);case 5:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()),this.pipeService.onRoot("gh_items_update",{},function(){var e=u(o().mark(function e(r,n){var i;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n&&n.app_id&&n.items)){e.next=5;break}return e.next=3,t.updateItems(n.app_id,n.items);case 3:(i=e.sent)?t.pipeService.emit("gh_items_update",n,i):t.pipeService.emit("gh_items_update",n,[]);case 5:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()),this.pipeService.onRoot("gh_item_get",{},function(){var e=u(o().mark(function e(r,n){var i,a;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!n||!n.app_id){e.next=6;break}return e.next=3,t.getItems(n.app_id);case 3:i=e.sent,a=i.find(function(t){return t.item_id==n.item_id}),t.pipeService.emit("gh_item_get",n,a);case 6:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()),this.pipeService.onRoot("gh_filtered_items_get",{},function(){var e=u(o().mark(function e(r,n){var i,a;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!n||!n.element_app_id){e.next=8;break}return e.next=3,t.getItems(n.element_app_id);case 3:return i=e.sent,e.next=6,t.util.getFilteredItems(i,n.filters_list,n.element_app_id,n.app_id,n.item_id,n.field_groupe,n.search,n.search_params);case 6:a=e.sent,t.pipeService.emit("gh_filtered_items_get",n,a);case 8:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()),this.pipeService.onRoot("gh_filter_items",{},function(){var e=u(o().mark(function e(r,n){var i;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!n||!n.items){e.next=5;break}return e.next=3,t.util.getFilteredItems(n.items,n.filters_list,n.element_app_id,n.app_id,n.item_id,n.field_groupe,n.search,n.search_params);case 3:i=e.sent,t.pipeService.emit("gh_filter_items",n,i);case 5:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}())}}]),e}();exports.ItemProcessor=h;
199
199
  },{"../utils.js":"EgeI"}],"PoPF":[function(require,module,exports) {