@bigbinary/neeto-github-frontend 1.0.6 → 1.0.8

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.
package/dist/index.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import React, { useState, useRef } from 'react';
2
- import { isPresent, noop } from '@bigbinary/neeto-cist';
3
- import { Button, Typography, Input, Pane } from '@bigbinary/neetoui';
4
- import { Trans, useTranslation } from 'react-i18next';
5
2
  import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
6
3
  import { Settings, Plus, Building, User, CannedResponses, Lock } from '@bigbinary/neeto-icons';
4
+ import { Button, Typography, Input, Pane } from '@bigbinary/neetoui';
7
5
  import { Github } from '@bigbinary/neeto-icons/misc';
8
- import { globalProps } from '@bigbinary/neeto-commons-frontend/initializers';
9
- import require$$0 from 'util';
10
- import Search from '@bigbinary/neeto-molecules/Search';
11
6
  import classNames from 'classnames';
7
+ import { isPresent, noop } from '@bigbinary/neeto-cist';
8
+ import Search from '@bigbinary/neeto-molecules/Search';
9
+ import { Trans, useTranslation } from 'react-i18next';
12
10
  import Scrollable from '@bigbinary/neeto-molecules/Scrollable';
13
11
  import DateFormat from '@bigbinary/neeto-molecules/DateFormat';
12
+ import { globalProps } from '@bigbinary/neeto-commons-frontend/initializers';
13
+ import require$$0 from 'util';
14
14
 
15
15
  var Configure = withT(function (_ref) {
16
16
  var t = _ref.t,
@@ -19,7 +19,7 @@ var Configure = withT(function (_ref) {
19
19
  return /*#__PURE__*/React.createElement("div", {
20
20
  className: "neeto-ui-text-gray-900 font-sans text-sm font-normal leading-6 antialiased"
21
21
  }, /*#__PURE__*/React.createElement(Button, {
22
- className: "mt-1 text-indigo-600 2xl:mt-3",
22
+ className: "mt-1 text-indigo-600 xl:mt-3",
23
23
  href: installationUrl,
24
24
  icon: isConnected ? Settings : Plus,
25
25
  iconPosition: "left",
@@ -89,12 +89,16 @@ var List$1 = withT(function (_ref) {
89
89
  });
90
90
 
91
91
  var Accounts = function Accounts(_ref) {
92
- var accounts = _ref.accounts,
92
+ var isPane = _ref.isPane,
93
+ accounts = _ref.accounts,
93
94
  isConnected = _ref.isConnected,
94
95
  onConnect = _ref.onConnect,
95
96
  installationUrl = _ref.installationUrl;
96
97
  return /*#__PURE__*/React.createElement("div", {
97
- className: "flex w-full flex-col border border-solid border-transparent px-0 py-2 2xl:max-w-sm 2xl:px-8"
98
+ className: classNames("flex w-full flex-col border border-solid border-transparent px-0 py-2", {
99
+ "2xl:max-w-sm 2xl:px-8": isPane,
100
+ "xl:max-w-sm xl:px-8": !isPane
101
+ })
98
102
  }, /*#__PURE__*/React.createElement("div", {
99
103
  className: "mb-2"
100
104
  }, /*#__PURE__*/React.createElement(Header, null), /*#__PURE__*/React.createElement(List$1, {
@@ -107,119 +111,459 @@ var Accounts = function Accounts(_ref) {
107
111
  })));
108
112
  };
109
113
 
110
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
111
-
112
- /* eslint complexity: [2, 18], max-statements: [2, 33] */
113
- var shams = function hasSymbols() {
114
- if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
115
- if (typeof Symbol.iterator === 'symbol') { return true; }
116
-
117
- var obj = {};
118
- var sym = Symbol('test');
119
- var symObj = Object(sym);
120
- if (typeof sym === 'string') { return false; }
121
-
122
- if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
123
- if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
124
-
125
- // temp disabled per https://github.com/ljharb/object.assign/issues/17
126
- // if (sym instanceof Symbol) { return false; }
127
- // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
128
- // if (!(symObj instanceof Symbol)) { return false; }
129
-
130
- // if (typeof Symbol.prototype.toString !== 'function') { return false; }
131
- // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
132
-
133
- var symVal = 42;
134
- obj[sym] = symVal;
135
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
136
- if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
137
-
138
- if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
139
-
140
- var syms = Object.getOwnPropertySymbols(obj);
141
- if (syms.length !== 1 || syms[0] !== sym) { return false; }
142
-
143
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
144
-
145
- if (typeof Object.getOwnPropertyDescriptor === 'function') {
146
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
147
- if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
148
- }
149
-
150
- return true;
151
- };
152
-
153
- var origSymbol = typeof Symbol !== 'undefined' && Symbol;
154
- var hasSymbolSham = shams;
155
-
156
- var hasSymbols$1 = function hasNativeSymbols() {
157
- if (typeof origSymbol !== 'function') { return false; }
158
- if (typeof Symbol !== 'function') { return false; }
159
- if (typeof origSymbol('foo') !== 'symbol') { return false; }
160
- if (typeof Symbol('bar') !== 'symbol') { return false; }
161
-
162
- return hasSymbolSham();
163
- };
164
-
165
- var test = {
166
- foo: {}
167
- };
168
-
169
- var $Object = Object;
170
-
171
- var hasProto$1 = function hasProto() {
172
- return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
173
- };
114
+ function _arrayWithHoles(arr) {
115
+ if (Array.isArray(arr)) return arr;
116
+ }
174
117
 
175
- /* eslint no-invalid-this: 1 */
118
+ function _iterableToArrayLimit(arr, i) {
119
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
120
+ if (null != _i) {
121
+ var _s,
122
+ _e,
123
+ _x,
124
+ _r,
125
+ _arr = [],
126
+ _n = !0,
127
+ _d = !1;
128
+ try {
129
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
130
+ if (Object(_i) !== _i) return;
131
+ _n = !1;
132
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
133
+ } catch (err) {
134
+ _d = !0, _e = err;
135
+ } finally {
136
+ try {
137
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
138
+ } finally {
139
+ if (_d) throw _e;
140
+ }
141
+ }
142
+ return _arr;
143
+ }
144
+ }
176
145
 
177
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
178
- var toStr$1 = Object.prototype.toString;
179
- var max = Math.max;
180
- var funcType = '[object Function]';
146
+ function _arrayLikeToArray(arr, len) {
147
+ if (len == null || len > arr.length) len = arr.length;
148
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
149
+ return arr2;
150
+ }
181
151
 
182
- var concatty = function concatty(a, b) {
183
- var arr = [];
152
+ function _unsupportedIterableToArray(o, minLen) {
153
+ if (!o) return;
154
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
155
+ var n = Object.prototype.toString.call(o).slice(8, -1);
156
+ if (n === "Object" && o.constructor) n = o.constructor.name;
157
+ if (n === "Map" || n === "Set") return Array.from(o);
158
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
159
+ }
184
160
 
185
- for (var i = 0; i < a.length; i += 1) {
186
- arr[i] = a[i];
187
- }
188
- for (var j = 0; j < b.length; j += 1) {
189
- arr[j + a.length] = b[j];
190
- }
161
+ function _nonIterableRest() {
162
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
163
+ }
191
164
 
192
- return arr;
193
- };
165
+ function _slicedToArray(arr, i) {
166
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
167
+ }
194
168
 
195
- var slicy = function slicy(arrLike, offset) {
196
- var arr = [];
197
- for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
198
- arr[j] = arrLike[i];
169
+ var NoRepositories = withT(function (_ref) {
170
+ var t = _ref.t,
171
+ installationUrl = _ref.installationUrl,
172
+ troubleshootUrl = _ref.troubleshootUrl;
173
+ return /*#__PURE__*/React.createElement("div", {
174
+ className: "flex w-full max-w-sm flex-col items-center justify-center space-y-4 text-center"
175
+ }, /*#__PURE__*/React.createElement(Typography, {
176
+ style: "body2"
177
+ }, t("neetoGithub.noReposDescription")), /*#__PURE__*/React.createElement(Button, {
178
+ href: installationUrl,
179
+ icon: Github,
180
+ iconPosition: "left",
181
+ label: t("neetoGithub.connectRepository"),
182
+ size: "medium",
183
+ style: "primary"
184
+ }), /*#__PURE__*/React.createElement("div", {
185
+ className: "text-xs"
186
+ }, /*#__PURE__*/React.createElement(Trans, {
187
+ i18nKey: "troubleshoot",
188
+ components: {
189
+ troubleshootLink: /*#__PURE__*/React.createElement("a", {
190
+ className: "text-indigo-600 underline",
191
+ href: troubleshootUrl,
192
+ rel: "noopener noreferrer",
193
+ target: "_blank"
194
+ })
199
195
  }
200
- return arr;
201
- };
196
+ })));
197
+ });
202
198
 
203
- var joiny = function (arr, joiner) {
204
- var str = '';
205
- for (var i = 0; i < arr.length; i += 1) {
206
- str += arr[i];
207
- if (i + 1 < arr.length) {
208
- str += joiner;
209
- }
199
+ var RepositoryTile = function RepositoryTile(_ref) {
200
+ var onConnect = _ref.onConnect,
201
+ repository = _ref.repository;
202
+ var _useTranslation = useTranslation(),
203
+ t = _useTranslation.t;
204
+ var id = repository.id,
205
+ fullName = repository.fullName,
206
+ isPrivate = repository.isPrivate,
207
+ updatedAt = repository.updatedAt;
208
+ return /*#__PURE__*/React.createElement("div", {
209
+ className: "neeto-ui-border-gray-300 flex items-center justify-between border-b border-l-0 border-r-0 border-t-0 border-solid py-3 pl-5 pr-3",
210
+ key: id
211
+ }, /*#__PURE__*/React.createElement("div", {
212
+ className: "width-calc flex items-center space-x-2"
213
+ }, /*#__PURE__*/React.createElement(Github, {
214
+ size: 16
215
+ }), /*#__PURE__*/React.createElement(Typography, {
216
+ style: "body2"
217
+ }, fullName), isPrivate && /*#__PURE__*/React.createElement(Lock, {
218
+ size: 16
219
+ }), /*#__PURE__*/React.createElement("div", {
220
+ className: "hidden md:inline-block"
221
+ }, /*#__PURE__*/React.createElement(Typography, {
222
+ className: "neeto-ui-text-gray-900 mx-2 text-sm",
223
+ component: "span",
224
+ style: "h3"
225
+ }, "\u2022"), /*#__PURE__*/React.createElement(DateFormat.FromNow, {
226
+ date: updatedAt
227
+ }))), /*#__PURE__*/React.createElement(Button, {
228
+ style: "primary",
229
+ type: "button",
230
+ onClick: function onClick() {
231
+ return onConnect({
232
+ repoType: "private",
233
+ repository: repository
234
+ });
210
235
  }
211
- return str;
236
+ }, t("neetoGithub.connect")));
212
237
  };
213
238
 
214
- var implementation$1 = function bind(that) {
215
- var target = this;
216
- if (typeof target !== 'function' || toStr$1.apply(target) !== funcType) {
217
- throw new TypeError(ERROR_MESSAGE + target);
218
- }
219
- var args = slicy(arguments, 1);
239
+ var List = withT(function (_ref) {
240
+ var t = _ref.t,
241
+ isPublicRepoAllowed = _ref.isPublicRepoAllowed,
242
+ filteredRepositories = _ref.filteredRepositories,
243
+ repositories = _ref.repositories,
244
+ onConnect = _ref.onConnect,
245
+ installationUrl = _ref.installationUrl,
246
+ troubleshootUrl = _ref.troubleshootUrl;
247
+ return /*#__PURE__*/React.createElement("div", {
248
+ className: classNames("neeto-ui-border-gray-300 neeto-ui-rounded-md m-0 flex flex-col items-center justify-center border border-solid p-0 2xl:h-96", {
249
+ "h-52": isPublicRepoAllowed,
250
+ "h-72": !isPublicRepoAllowed
251
+ })
252
+ }, isPresent(repositories) ? /*#__PURE__*/React.createElement(Scrollable, {
253
+ className: "m-0 h-full w-full overflow-y-scroll p-0 shadow-inner"
254
+ }, isPresent(filteredRepositories) ? filteredRepositories.map(function (repository) {
255
+ return /*#__PURE__*/React.createElement(RepositoryTile, {
256
+ onConnect: onConnect,
257
+ repository: repository
258
+ });
259
+ }) : /*#__PURE__*/React.createElement(Typography, {
260
+ className: "flex h-full w-full items-center justify-center",
261
+ style: "body2"
262
+ }, t("neetoGithub.noRepos"))) : /*#__PURE__*/React.createElement(NoRepositories, {
263
+ installationUrl: installationUrl,
264
+ troubleshootUrl: troubleshootUrl
265
+ }));
266
+ });
220
267
 
221
- var bound;
222
- var binder = function () {
268
+ var NotConnected = withT(function (_ref) {
269
+ var t = _ref.t,
270
+ installationUrl = _ref.installationUrl;
271
+ return /*#__PURE__*/React.createElement("div", {
272
+ className: "flex w-full max-w-sm flex-col items-center justify-center space-y-4 text-center"
273
+ }, /*#__PURE__*/React.createElement(Typography, {
274
+ style: "body2"
275
+ }, t("neetoGithub.notConnectedDescription")), /*#__PURE__*/React.createElement(Button, {
276
+ href: installationUrl,
277
+ icon: Github,
278
+ iconPosition: "left",
279
+ label: t("neetoGithub.connectGithub"),
280
+ size: "medium",
281
+ style: "primary"
282
+ }));
283
+ });
284
+
285
+ var Private = function Private(_ref) {
286
+ var isConnected = _ref.isConnected,
287
+ isPublicRepoAllowed = _ref.isPublicRepoAllowed,
288
+ repositories = _ref.repositories,
289
+ onConnect = _ref.onConnect,
290
+ installationUrl = _ref.installationUrl,
291
+ troubleshootUrl = _ref.troubleshootUrl;
292
+ var _useTranslation = useTranslation(),
293
+ t = _useTranslation.t;
294
+ var _useState = useState(repositories),
295
+ _useState2 = _slicedToArray(_useState, 2),
296
+ filteredRepositories = _useState2[0],
297
+ setFilteredRepositories = _useState2[1];
298
+ var onSearch = function onSearch(searchTerm) {
299
+ if (!isPresent(searchTerm)) {
300
+ setFilteredRepositories(repositories);
301
+ return;
302
+ }
303
+ var filteredRepositories = repositories.filter(function (_ref2) {
304
+ var fullName = _ref2.fullName;
305
+ return fullName.toLowerCase().includes(searchTerm.toLowerCase());
306
+ });
307
+ setFilteredRepositories(filteredRepositories);
308
+ };
309
+ return /*#__PURE__*/React.createElement("div", {
310
+ className: "connect-repo neeto-ui-rounded-md neeto-ui-border-gray-300 border border-solid px-8 py-7"
311
+ }, /*#__PURE__*/React.createElement(Typography, {
312
+ className: "mb-2 pb-5 text-lg font-medium",
313
+ style: "h2"
314
+ }, t("neetoGithub.connectARepo")), isConnected ? /*#__PURE__*/React.createElement("div", {
315
+ className: "flex w-full flex-col space-y-6"
316
+ }, /*#__PURE__*/React.createElement(Search, {
317
+ onSearch: onSearch,
318
+ className: "w-full",
319
+ suffix: /*#__PURE__*/React.createElement(Typography, {
320
+ style: "body2"
321
+ }, t("neetoGithub.countOf.repos", {
322
+ count: filteredRepositories.length
323
+ }))
324
+ }), /*#__PURE__*/React.createElement(List, {
325
+ isPublicRepoAllowed: isPublicRepoAllowed,
326
+ filteredRepositories: filteredRepositories,
327
+ installationUrl: installationUrl,
328
+ onConnect: onConnect,
329
+ repositories: repositories,
330
+ troubleshootUrl: troubleshootUrl
331
+ })) : /*#__PURE__*/React.createElement("div", {
332
+ className: "neeto-ui-text-gray-900 font-sans text-sm font-normal leading-6 antialiased"
333
+ }, /*#__PURE__*/React.createElement("div", {
334
+ className: "neeto-ui-rounded-md neeto-ui-border-gray-300 m-0 flex h-[366px] flex-col items-center justify-center border border-solid p-4 shadow-inner"
335
+ }, /*#__PURE__*/React.createElement(NotConnected, {
336
+ installationUrl: installationUrl
337
+ }))));
338
+ };
339
+
340
+ var Public = function Public(_ref) {
341
+ var onConnect = _ref.onConnect;
342
+ var _useTranslation = useTranslation(),
343
+ t = _useTranslation.t;
344
+ var _useState = useState(""),
345
+ _useState2 = _slicedToArray(_useState, 2),
346
+ publicRepoUrl = _useState2[0],
347
+ setPublicRepoUrl = _useState2[1];
348
+ return /*#__PURE__*/React.createElement("div", {
349
+ className: "transition-drop-shadow neeto-ui-border-gray-300 neeto-ui-rounded-md border border-solid px-8 py-7 font-sans transition-colors"
350
+ }, /*#__PURE__*/React.createElement("div", {
351
+ className: "mb-2 pb-5"
352
+ }, /*#__PURE__*/React.createElement("div", {
353
+ className: "flex justify-between"
354
+ }, /*#__PURE__*/React.createElement("div", {
355
+ className: "pr-4"
356
+ }, /*#__PURE__*/React.createElement(Typography, {
357
+ className: "text-lg font-medium",
358
+ style: "h2"
359
+ }, t("neetoGithub.publicGitRepo")), /*#__PURE__*/React.createElement("div", {
360
+ className: "neeto-ui-text-gray-900 mt-2 flex max-w-xl space-x-1 font-sans text-sm font-normal leading-6 antialiased"
361
+ }, /*#__PURE__*/React.createElement(Typography, {
362
+ style: "body2"
363
+ }, t("neetoGithub.publicGitRepoDescription")))))), /*#__PURE__*/React.createElement("div", {
364
+ className: "neeto-ui-text-gray-900 font-sans text-sm font-normal leading-6 antialiased"
365
+ }, /*#__PURE__*/React.createElement("div", {
366
+ className: "flex"
367
+ }, /*#__PURE__*/React.createElement("div", {
368
+ className: "z-0 flex-1"
369
+ }, /*#__PURE__*/React.createElement("div", {
370
+ className: "w-full"
371
+ }, /*#__PURE__*/React.createElement(Input, {
372
+ nakedInput: true,
373
+ autocomplete: "false",
374
+ className: "relative rounded-b rounded-l rounded-r-none rounded-t border-b border-l border-r-0 border-t border-solid px-2",
375
+ placeholder: t("neetoGithub.publicGitRepoPlaceholder"),
376
+ size: "large",
377
+ spellcheck: "false",
378
+ type: "text",
379
+ value: publicRepoUrl,
380
+ onChange: function onChange(e) {
381
+ return setPublicRepoUrl(e.target.value);
382
+ }
383
+ }))), /*#__PURE__*/React.createElement("div", {
384
+ className: "relative"
385
+ }, /*#__PURE__*/React.createElement(Button, {
386
+ className: "rounded-b rounded-l-none rounded-r rounded-t",
387
+ disabled: !isPresent(publicRepoUrl),
388
+ size: "large",
389
+ style: "primary",
390
+ type: "button",
391
+ onClick: function onClick() {
392
+ return onConnect({
393
+ repoType: "public",
394
+ repository: {
395
+ fullName: publicRepoUrl
396
+ }
397
+ });
398
+ }
399
+ }, t("neetoGithub.continue"))))));
400
+ };
401
+
402
+ var Repositories = function Repositories(_ref) {
403
+ var isConnected = _ref.isConnected,
404
+ isPublicRepoAllowed = _ref.isPublicRepoAllowed,
405
+ repositories = _ref.repositories,
406
+ onConnect = _ref.onConnect,
407
+ installationUrl = _ref.installationUrl,
408
+ troubleshootUrl = _ref.troubleshootUrl;
409
+ return /*#__PURE__*/React.createElement("div", {
410
+ className: "w-full space-y-6"
411
+ }, /*#__PURE__*/React.createElement(Private, {
412
+ isPublicRepoAllowed: isPublicRepoAllowed,
413
+ installationUrl: installationUrl,
414
+ isConnected: isConnected,
415
+ onConnect: onConnect,
416
+ repositories: repositories,
417
+ troubleshootUrl: troubleshootUrl
418
+ }), isPublicRepoAllowed && /*#__PURE__*/React.createElement(Public, {
419
+ onConnect: onConnect
420
+ }));
421
+ };
422
+
423
+ var NeetoGithubNanoContainer = function NeetoGithubNanoContainer(_ref) {
424
+ var _ref$accounts = _ref.accounts,
425
+ accounts = _ref$accounts === void 0 ? [] : _ref$accounts,
426
+ installationUrl = _ref.installationUrl,
427
+ isConnected = _ref.isConnected,
428
+ _ref$isPublicRepoAllo = _ref.isPublicRepoAllowed,
429
+ isPublicRepoAllowed = _ref$isPublicRepoAllo === void 0 ? false : _ref$isPublicRepoAllo,
430
+ onConnect = _ref.onConnect,
431
+ _ref$repositories = _ref.repositories,
432
+ repositories = _ref$repositories === void 0 ? [] : _ref$repositories,
433
+ troubleshootUrl = _ref.troubleshootUrl,
434
+ _ref$isPane = _ref.isPane,
435
+ isPane = _ref$isPane === void 0 ? false : _ref$isPane;
436
+ return /*#__PURE__*/React.createElement("div", {
437
+ className: "flex w-full flex-col-reverse 2xl:flex-row"
438
+ }, /*#__PURE__*/React.createElement(Repositories, {
439
+ installationUrl: installationUrl,
440
+ isConnected: isConnected,
441
+ isPublicRepoAllowed: isPublicRepoAllowed,
442
+ onConnect: onConnect,
443
+ repositories: repositories,
444
+ troubleshootUrl: troubleshootUrl
445
+ }), /*#__PURE__*/React.createElement(Accounts, {
446
+ accounts: accounts,
447
+ installationUrl: installationUrl,
448
+ isConnected: isConnected,
449
+ onConnect: onConnect,
450
+ isPane: isPane
451
+ }));
452
+ };
453
+
454
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
455
+
456
+ /* eslint complexity: [2, 18], max-statements: [2, 33] */
457
+ var shams = function hasSymbols() {
458
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
459
+ if (typeof Symbol.iterator === 'symbol') { return true; }
460
+
461
+ var obj = {};
462
+ var sym = Symbol('test');
463
+ var symObj = Object(sym);
464
+ if (typeof sym === 'string') { return false; }
465
+
466
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
467
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
468
+
469
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
470
+ // if (sym instanceof Symbol) { return false; }
471
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
472
+ // if (!(symObj instanceof Symbol)) { return false; }
473
+
474
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
475
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
476
+
477
+ var symVal = 42;
478
+ obj[sym] = symVal;
479
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
480
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
481
+
482
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
483
+
484
+ var syms = Object.getOwnPropertySymbols(obj);
485
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
486
+
487
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
488
+
489
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
490
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
491
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
492
+ }
493
+
494
+ return true;
495
+ };
496
+
497
+ var origSymbol = typeof Symbol !== 'undefined' && Symbol;
498
+ var hasSymbolSham = shams;
499
+
500
+ var hasSymbols$1 = function hasNativeSymbols() {
501
+ if (typeof origSymbol !== 'function') { return false; }
502
+ if (typeof Symbol !== 'function') { return false; }
503
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
504
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
505
+
506
+ return hasSymbolSham();
507
+ };
508
+
509
+ var test = {
510
+ foo: {}
511
+ };
512
+
513
+ var $Object = Object;
514
+
515
+ var hasProto$1 = function hasProto() {
516
+ return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
517
+ };
518
+
519
+ /* eslint no-invalid-this: 1 */
520
+
521
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
522
+ var toStr$1 = Object.prototype.toString;
523
+ var max = Math.max;
524
+ var funcType = '[object Function]';
525
+
526
+ var concatty = function concatty(a, b) {
527
+ var arr = [];
528
+
529
+ for (var i = 0; i < a.length; i += 1) {
530
+ arr[i] = a[i];
531
+ }
532
+ for (var j = 0; j < b.length; j += 1) {
533
+ arr[j + a.length] = b[j];
534
+ }
535
+
536
+ return arr;
537
+ };
538
+
539
+ var slicy = function slicy(arrLike, offset) {
540
+ var arr = [];
541
+ for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
542
+ arr[j] = arrLike[i];
543
+ }
544
+ return arr;
545
+ };
546
+
547
+ var joiny = function (arr, joiner) {
548
+ var str = '';
549
+ for (var i = 0; i < arr.length; i += 1) {
550
+ str += arr[i];
551
+ if (i + 1 < arr.length) {
552
+ str += joiner;
553
+ }
554
+ }
555
+ return str;
556
+ };
557
+
558
+ var implementation$1 = function bind(that) {
559
+ var target = this;
560
+ if (typeof target !== 'function' || toStr$1.apply(target) !== funcType) {
561
+ throw new TypeError(ERROR_MESSAGE + target);
562
+ }
563
+ var args = slicy(arguments, 1);
564
+
565
+ var bound;
566
+ var binder = function () {
223
567
  if (this instanceof bound) {
224
568
  var result = target.apply(
225
569
  this,
@@ -2279,401 +2623,92 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesPars
2279
2623
  // If there's a remainder, just add whatever is left
2280
2624
 
2281
2625
  if (segment) {
2282
- keys.push('[' + key.slice(segment.index) + ']');
2283
- }
2284
-
2285
- return parseObject(keys, val, options, valuesParsed);
2286
- };
2287
-
2288
- var normalizeParseOptions = function normalizeParseOptions(opts) {
2289
- if (!opts) {
2290
- return defaults;
2291
- }
2292
-
2293
- if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
2294
- throw new TypeError('Decoder has to be a function.');
2295
- }
2296
-
2297
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
2298
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
2299
- }
2300
- var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
2301
-
2302
- return {
2303
- allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
2304
- allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
2305
- allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
2306
- arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
2307
- charset: charset,
2308
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
2309
- comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
2310
- decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
2311
- delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
2312
- // eslint-disable-next-line no-implicit-coercion, no-extra-parens
2313
- depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
2314
- ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
2315
- interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
2316
- parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
2317
- parseArrays: opts.parseArrays !== false,
2318
- plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
2319
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
2320
- };
2321
- };
2322
-
2323
- var parse$1 = function (str, opts) {
2324
- var options = normalizeParseOptions(opts);
2325
-
2326
- if (str === '' || str === null || typeof str === 'undefined') {
2327
- return options.plainObjects ? Object.create(null) : {};
2328
- }
2329
-
2330
- var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
2331
- var obj = options.plainObjects ? Object.create(null) : {};
2332
-
2333
- // Iterate over the keys and setup the new object
2334
-
2335
- var keys = Object.keys(tempObj);
2336
- for (var i = 0; i < keys.length; ++i) {
2337
- var key = keys[i];
2338
- var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
2339
- obj = utils.merge(obj, newObj, options);
2340
- }
2341
-
2342
- if (options.allowSparse === true) {
2343
- return obj;
2344
- }
2345
-
2346
- return utils.compact(obj);
2347
- };
2348
-
2349
- var stringify = stringify_1;
2350
- var parse = parse$1;
2351
- var formats = formats$3;
2352
-
2353
- var lib = {
2354
- formats: formats,
2355
- parse: parse,
2356
- stringify: stringify
2357
- };
2358
-
2359
- var _globalProps$organiza;
2360
- var newInstallationParams = lib.stringify({
2361
- integrator_id: globalProps === null || globalProps === void 0 || (_globalProps$organiza = globalProps.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.id,
2362
- integrator_type: "Organization",
2363
- redirect_path: "/projects/new"
2364
- });
2365
- var NEW_INSTALLATION_URL = "/github_integrations/app_installations/new?".concat(newInstallationParams);
2366
- var TROUBLESHOOT_URL = "https://render.com/docs/github#troubleshooting";
2367
-
2368
- function _arrayWithHoles(arr) {
2369
- if (Array.isArray(arr)) return arr;
2370
- }
2371
-
2372
- function _iterableToArrayLimit(arr, i) {
2373
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
2374
- if (null != _i) {
2375
- var _s,
2376
- _e,
2377
- _x,
2378
- _r,
2379
- _arr = [],
2380
- _n = !0,
2381
- _d = !1;
2382
- try {
2383
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
2384
- if (Object(_i) !== _i) return;
2385
- _n = !1;
2386
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
2387
- } catch (err) {
2388
- _d = !0, _e = err;
2389
- } finally {
2390
- try {
2391
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
2392
- } finally {
2393
- if (_d) throw _e;
2394
- }
2395
- }
2396
- return _arr;
2397
- }
2398
- }
2399
-
2400
- function _arrayLikeToArray(arr, len) {
2401
- if (len == null || len > arr.length) len = arr.length;
2402
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
2403
- return arr2;
2404
- }
2405
-
2406
- function _unsupportedIterableToArray(o, minLen) {
2407
- if (!o) return;
2408
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
2409
- var n = Object.prototype.toString.call(o).slice(8, -1);
2410
- if (n === "Object" && o.constructor) n = o.constructor.name;
2411
- if (n === "Map" || n === "Set") return Array.from(o);
2412
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
2413
- }
2414
-
2415
- function _nonIterableRest() {
2416
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2417
- }
2418
-
2419
- function _slicedToArray(arr, i) {
2420
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
2421
- }
2422
-
2423
- var NoRepositories = withT(function (_ref) {
2424
- var t = _ref.t,
2425
- installationUrl = _ref.installationUrl,
2426
- troubleshootUrl = _ref.troubleshootUrl;
2427
- return /*#__PURE__*/React.createElement("div", {
2428
- className: "flex w-full max-w-sm flex-col items-center justify-center space-y-4 text-center"
2429
- }, /*#__PURE__*/React.createElement(Typography, {
2430
- style: "body2"
2431
- }, t("neetoGithub.noReposDescription")), /*#__PURE__*/React.createElement(Button, {
2432
- href: installationUrl,
2433
- icon: Github,
2434
- iconPosition: "left",
2435
- label: t("neetoGithub.connectRepository"),
2436
- size: "medium",
2437
- style: "primary"
2438
- }), /*#__PURE__*/React.createElement("div", {
2439
- className: "text-xs"
2440
- }, /*#__PURE__*/React.createElement(Trans, {
2441
- i18nKey: "troubleshoot",
2442
- components: {
2443
- troubleshootLink: /*#__PURE__*/React.createElement("a", {
2444
- className: "text-indigo-600 underline",
2445
- href: troubleshootUrl,
2446
- rel: "noopener noreferrer",
2447
- target: "_blank"
2448
- })
2449
- }
2450
- })));
2451
- });
2452
-
2453
- var RepositoryTile = function RepositoryTile(_ref) {
2454
- var onConnect = _ref.onConnect,
2455
- repository = _ref.repository;
2456
- var _useTranslation = useTranslation(),
2457
- t = _useTranslation.t;
2458
- var id = repository.id,
2459
- fullName = repository.fullName,
2460
- isPrivate = repository.isPrivate,
2461
- updatedAt = repository.updatedAt;
2462
- return /*#__PURE__*/React.createElement("div", {
2463
- className: "neeto-ui-border-gray-300 flex items-center justify-between border-b border-l-0 border-r-0 border-t-0 border-solid py-3 pl-5 pr-3",
2464
- key: id
2465
- }, /*#__PURE__*/React.createElement("div", {
2466
- className: "width-calc flex items-center space-x-2"
2467
- }, /*#__PURE__*/React.createElement(Github, {
2468
- size: 16
2469
- }), /*#__PURE__*/React.createElement(Typography, {
2470
- style: "body2"
2471
- }, fullName), isPrivate && /*#__PURE__*/React.createElement(Lock, {
2472
- size: 16
2473
- }), /*#__PURE__*/React.createElement("div", {
2474
- className: "hidden md:inline-block"
2475
- }, /*#__PURE__*/React.createElement(Typography, {
2476
- className: "neeto-ui-text-gray-900 mx-2 text-sm",
2477
- component: "span",
2478
- style: "h3"
2479
- }, "\u2022"), /*#__PURE__*/React.createElement(DateFormat.FromNow, {
2480
- date: updatedAt
2481
- }))), /*#__PURE__*/React.createElement(Button, {
2482
- style: "primary",
2483
- type: "button",
2484
- onClick: function onClick() {
2485
- return onConnect({
2486
- repoType: "private",
2487
- repository: repository
2488
- });
2626
+ keys.push('[' + key.slice(segment.index) + ']');
2489
2627
  }
2490
- }, t("neetoGithub.connect")));
2628
+
2629
+ return parseObject(keys, val, options, valuesParsed);
2491
2630
  };
2492
2631
 
2493
- var List = withT(function (_ref) {
2494
- var t = _ref.t,
2495
- isPublicRepoAllowed = _ref.isPublicRepoAllowed,
2496
- filteredRepositories = _ref.filteredRepositories,
2497
- repositories = _ref.repositories,
2498
- onConnect = _ref.onConnect,
2499
- installationUrl = _ref.installationUrl,
2500
- troubleshootUrl = _ref.troubleshootUrl;
2501
- return /*#__PURE__*/React.createElement("div", {
2502
- className: classNames("neeto-ui-border-gray-300 neeto-ui-rounded-md m-0 flex flex-col items-center justify-center border border-solid p-0 2xl:h-96", {
2503
- "h-52": isPublicRepoAllowed,
2504
- "h-72": !isPublicRepoAllowed
2505
- })
2506
- }, isPresent(repositories) ? /*#__PURE__*/React.createElement(Scrollable, {
2507
- className: "m-0 h-full w-full overflow-y-scroll p-0 shadow-inner"
2508
- }, isPresent(filteredRepositories) ? filteredRepositories.map(function (repository) {
2509
- return /*#__PURE__*/React.createElement(RepositoryTile, {
2510
- onConnect: onConnect,
2511
- repository: repository
2512
- });
2513
- }) : /*#__PURE__*/React.createElement(Typography, {
2514
- className: "flex h-full w-full items-center justify-center",
2515
- style: "body2"
2516
- }, t("neetoGithub.noRepos"))) : /*#__PURE__*/React.createElement(NoRepositories, {
2517
- installationUrl: installationUrl,
2518
- troubleshootUrl: troubleshootUrl
2519
- }));
2520
- });
2632
+ var normalizeParseOptions = function normalizeParseOptions(opts) {
2633
+ if (!opts) {
2634
+ return defaults;
2635
+ }
2521
2636
 
2522
- var NotConnected = withT(function (_ref) {
2523
- var t = _ref.t,
2524
- installationUrl = _ref.installationUrl;
2525
- return /*#__PURE__*/React.createElement("div", {
2526
- className: "flex w-full max-w-sm flex-col items-center justify-center space-y-4 text-center"
2527
- }, /*#__PURE__*/React.createElement(Typography, {
2528
- style: "body2"
2529
- }, t("neetoGithub.notConnectedDescription")), /*#__PURE__*/React.createElement(Button, {
2530
- href: installationUrl,
2531
- icon: Github,
2532
- iconPosition: "left",
2533
- label: t("neetoGithub.connectGithub"),
2534
- size: "medium",
2535
- style: "primary"
2536
- }));
2537
- });
2637
+ if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
2638
+ throw new TypeError('Decoder has to be a function.');
2639
+ }
2538
2640
 
2539
- var Private = function Private(_ref) {
2540
- var isConnected = _ref.isConnected,
2541
- isPublicRepoAllowed = _ref.isPublicRepoAllowed,
2542
- repositories = _ref.repositories,
2543
- onConnect = _ref.onConnect,
2544
- installationUrl = _ref.installationUrl,
2545
- troubleshootUrl = _ref.troubleshootUrl;
2546
- var _useTranslation = useTranslation(),
2547
- t = _useTranslation.t;
2548
- var _useState = useState(repositories),
2549
- _useState2 = _slicedToArray(_useState, 2),
2550
- filteredRepositories = _useState2[0],
2551
- setFilteredRepositories = _useState2[1];
2552
- var onSearch = function onSearch(searchTerm) {
2553
- if (!isPresent(searchTerm)) {
2554
- setFilteredRepositories(repositories);
2555
- return;
2641
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
2642
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
2556
2643
  }
2557
- var filteredRepositories = repositories.filter(function (_ref2) {
2558
- var fullName = _ref2.fullName;
2559
- return fullName.toLowerCase().includes(searchTerm.toLowerCase());
2560
- });
2561
- setFilteredRepositories(filteredRepositories);
2562
- };
2563
- return /*#__PURE__*/React.createElement("div", {
2564
- className: "connect-repo neeto-ui-rounded-md neeto-ui-border-gray-300 border border-solid px-8 py-7"
2565
- }, /*#__PURE__*/React.createElement(Typography, {
2566
- className: "mb-2 pb-5 text-lg font-medium",
2567
- style: "h2"
2568
- }, t("neetoGithub.connectARepo")), isConnected ? /*#__PURE__*/React.createElement("div", {
2569
- className: "flex w-full flex-col space-y-6"
2570
- }, /*#__PURE__*/React.createElement(Search, {
2571
- onSearch: onSearch,
2572
- className: "w-full",
2573
- suffix: /*#__PURE__*/React.createElement(Typography, {
2574
- style: "body2"
2575
- }, t("neetoGithub.countOf.repos", {
2576
- count: filteredRepositories.length
2577
- }))
2578
- }), /*#__PURE__*/React.createElement(List, {
2579
- isPublicRepoAllowed: isPublicRepoAllowed,
2580
- filteredRepositories: filteredRepositories,
2581
- installationUrl: installationUrl,
2582
- onConnect: onConnect,
2583
- repositories: repositories,
2584
- troubleshootUrl: troubleshootUrl
2585
- })) : /*#__PURE__*/React.createElement("div", {
2586
- className: "neeto-ui-text-gray-900 font-sans text-sm font-normal leading-6 antialiased"
2587
- }, /*#__PURE__*/React.createElement("div", {
2588
- className: "neeto-ui-rounded-md neeto-ui-border-gray-300 m-0 flex h-[366px] flex-col items-center justify-center border border-solid p-4 shadow-inner"
2589
- }, /*#__PURE__*/React.createElement(NotConnected, {
2590
- installationUrl: installationUrl
2591
- }))));
2644
+ var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
2645
+
2646
+ return {
2647
+ allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
2648
+ allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
2649
+ allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
2650
+ arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
2651
+ charset: charset,
2652
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
2653
+ comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
2654
+ decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
2655
+ delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
2656
+ // eslint-disable-next-line no-implicit-coercion, no-extra-parens
2657
+ depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
2658
+ ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
2659
+ interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
2660
+ parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
2661
+ parseArrays: opts.parseArrays !== false,
2662
+ plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
2663
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
2664
+ };
2592
2665
  };
2593
2666
 
2594
- var Public = function Public(_ref) {
2595
- var onConnect = _ref.onConnect;
2596
- var _useTranslation = useTranslation(),
2597
- t = _useTranslation.t;
2598
- var _useState = useState(""),
2599
- _useState2 = _slicedToArray(_useState, 2),
2600
- publicRepoUrl = _useState2[0],
2601
- setPublicRepoUrl = _useState2[1];
2602
- return /*#__PURE__*/React.createElement("div", {
2603
- className: "transition-drop-shadow neeto-ui-border-gray-300 neeto-ui-rounded-md border border-solid px-8 py-7 font-sans transition-colors"
2604
- }, /*#__PURE__*/React.createElement("div", {
2605
- className: "mb-2 pb-5"
2606
- }, /*#__PURE__*/React.createElement("div", {
2607
- className: "flex justify-between"
2608
- }, /*#__PURE__*/React.createElement("div", {
2609
- className: "pr-4"
2610
- }, /*#__PURE__*/React.createElement(Typography, {
2611
- className: "text-lg font-medium",
2612
- style: "h2"
2613
- }, t("neetoGithub.publicGitRepo")), /*#__PURE__*/React.createElement("div", {
2614
- className: "neeto-ui-text-gray-900 mt-2 flex max-w-xl space-x-1 font-sans text-sm font-normal leading-6 antialiased"
2615
- }, /*#__PURE__*/React.createElement(Typography, {
2616
- style: "body2"
2617
- }, t("neetoGithub.publicGitRepoDescription")))))), /*#__PURE__*/React.createElement("div", {
2618
- className: "neeto-ui-text-gray-900 font-sans text-sm font-normal leading-6 antialiased"
2619
- }, /*#__PURE__*/React.createElement("div", {
2620
- className: "flex"
2621
- }, /*#__PURE__*/React.createElement("div", {
2622
- className: "z-0 flex-1"
2623
- }, /*#__PURE__*/React.createElement("div", {
2624
- className: "w-full"
2625
- }, /*#__PURE__*/React.createElement(Input, {
2626
- nakedInput: true,
2627
- autocomplete: "false",
2628
- className: "relative rounded-b rounded-l rounded-r-none rounded-t border-b border-l border-r-0 border-t border-solid px-2",
2629
- placeholder: t("neetoGithub.publicGitRepoPlaceholder"),
2630
- size: "large",
2631
- spellcheck: "false",
2632
- type: "text",
2633
- value: publicRepoUrl,
2634
- onChange: function onChange(e) {
2635
- return setPublicRepoUrl(e.target.value);
2667
+ var parse$1 = function (str, opts) {
2668
+ var options = normalizeParseOptions(opts);
2669
+
2670
+ if (str === '' || str === null || typeof str === 'undefined') {
2671
+ return options.plainObjects ? Object.create(null) : {};
2636
2672
  }
2637
- }))), /*#__PURE__*/React.createElement("div", {
2638
- className: "relative"
2639
- }, /*#__PURE__*/React.createElement(Button, {
2640
- className: "rounded-b rounded-l-none rounded-r rounded-t",
2641
- disabled: !isPresent(publicRepoUrl),
2642
- size: "large",
2643
- style: "primary",
2644
- type: "button",
2645
- onClick: function onClick() {
2646
- return onConnect({
2647
- repoType: "public",
2648
- repository: {
2649
- fullName: publicRepoUrl
2650
- }
2651
- });
2673
+
2674
+ var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
2675
+ var obj = options.plainObjects ? Object.create(null) : {};
2676
+
2677
+ // Iterate over the keys and setup the new object
2678
+
2679
+ var keys = Object.keys(tempObj);
2680
+ for (var i = 0; i < keys.length; ++i) {
2681
+ var key = keys[i];
2682
+ var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
2683
+ obj = utils.merge(obj, newObj, options);
2652
2684
  }
2653
- }, t("neetoGithub.continue"))))));
2685
+
2686
+ if (options.allowSparse === true) {
2687
+ return obj;
2688
+ }
2689
+
2690
+ return utils.compact(obj);
2654
2691
  };
2655
2692
 
2656
- var Repositories = function Repositories(_ref) {
2657
- var isConnected = _ref.isConnected,
2658
- isPublicRepoAllowed = _ref.isPublicRepoAllowed,
2659
- repositories = _ref.repositories,
2660
- onConnect = _ref.onConnect,
2661
- installationUrl = _ref.installationUrl,
2662
- troubleshootUrl = _ref.troubleshootUrl;
2663
- return /*#__PURE__*/React.createElement("div", {
2664
- className: "w-full space-y-6 2xl:max-w-7xl"
2665
- }, /*#__PURE__*/React.createElement(Private, {
2666
- isPublicRepoAllowed: isPublicRepoAllowed,
2667
- installationUrl: installationUrl,
2668
- isConnected: isConnected,
2669
- onConnect: onConnect,
2670
- repositories: repositories,
2671
- troubleshootUrl: troubleshootUrl
2672
- }), isPublicRepoAllowed && /*#__PURE__*/React.createElement(Public, {
2673
- onConnect: onConnect
2674
- }));
2693
+ var stringify = stringify_1;
2694
+ var parse = parse$1;
2695
+ var formats = formats$3;
2696
+
2697
+ var lib = {
2698
+ formats: formats,
2699
+ parse: parse,
2700
+ stringify: stringify
2675
2701
  };
2676
2702
 
2703
+ var _globalProps$organiza;
2704
+ var newInstallationParams = lib.stringify({
2705
+ integrator_id: globalProps === null || globalProps === void 0 || (_globalProps$organiza = globalProps.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.id,
2706
+ integrator_type: "Organization",
2707
+ redirect_path: "/projects/new"
2708
+ });
2709
+ var NEW_INSTALLATION_URL = "/github_integrations/app_installations/new?".concat(newInstallationParams);
2710
+ var TROUBLESHOOT_URL = "https://render.com/docs/github#troubleshooting";
2711
+
2677
2712
  var NeetoGithubNanoModal = function NeetoGithubNanoModal(_ref) {
2678
2713
  var isOpen = _ref.isOpen,
2679
2714
  onClose = _ref.onClose,
@@ -2705,23 +2740,16 @@ var NeetoGithubNanoModal = function NeetoGithubNanoModal(_ref) {
2705
2740
  }, t("neetoGithub.modal.title")), /*#__PURE__*/React.createElement(Typography, {
2706
2741
  className: "mt-4",
2707
2742
  style: "body2"
2708
- }, t("neetoGithub.modal.description"))), /*#__PURE__*/React.createElement(Pane.Body, null, /*#__PURE__*/React.createElement("div", {
2709
- className: "w-full"
2710
- }, /*#__PURE__*/React.createElement("div", {
2711
- className: "flex flex-col-reverse 2xl:flex-row"
2712
- }, /*#__PURE__*/React.createElement(Repositories, {
2743
+ }, t("neetoGithub.modal.description"))), /*#__PURE__*/React.createElement(Pane.Body, null, /*#__PURE__*/React.createElement(NeetoGithubNanoContainer, {
2744
+ accounts: accounts,
2713
2745
  installationUrl: installationUrl,
2714
2746
  isConnected: isConnected,
2715
2747
  isPublicRepoAllowed: isPublicRepoAllowed,
2716
2748
  onConnect: onConnect,
2717
2749
  repositories: repositories,
2718
- troubleshootUrl: troubleshootUrl
2719
- }), /*#__PURE__*/React.createElement(Accounts, {
2720
- accounts: accounts,
2721
- installationUrl: installationUrl,
2722
- isConnected: isConnected,
2723
- onConnect: onConnect
2724
- })))));
2750
+ troubleshootUrl: troubleshootUrl,
2751
+ isPane: true
2752
+ })));
2725
2753
  };
2726
2754
 
2727
2755
  var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
@@ -2729,5 +2757,5 @@ var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r
2729
2757
  var css = ".width-calc{width:calc(100% - 82px)}.neeto-github-modal-pane-wrapper{width:min(75%,1280px)}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3JlcG9zaXRvcnktdGlsZS5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uc2NzcyIsImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3BhbmUuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUNFLHVCQ0NGLENDRkEsaUNBQ0UscUJES0YiLCJzb3VyY2VzQ29udGVudCI6WyIud2lkdGgtY2FsYyB7XG4gIHdpZHRoOiBjYWxjKDEwMCUgLSA4MnB4KTtcbn1cbiIsIi53aWR0aC1jYWxjIHtcbiAgd2lkdGg6IGNhbGMoMTAwJSAtIDgycHgpO1xufVxuXG4ubmVldG8tZ2l0aHViLW1vZGFsLXBhbmUtd3JhcHBlciB7XG4gIHdpZHRoOiBtaW4oNzUlLCAxMjgwcHgpO1xufSIsIi5uZWV0by1naXRodWItbW9kYWwtcGFuZS13cmFwcGVyIHtcbiAgd2lkdGg6IG1pbig3NSUsIDEyODBweCk7XG59XG4iXX0= */";
2730
2758
  n(css,{});
2731
2759
 
2732
- export { NeetoGithubNanoModal };
2760
+ export { NeetoGithubNanoContainer, NeetoGithubNanoModal };
2733
2761
  //# sourceMappingURL=index.js.map