pollination-react-io 1.19.0 → 1.20.0

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.
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { FileSystemProps } from './FileSystem.types';
3
+ import './FileSystem.scss';
4
+ declare const FileSystem: React.FC<FileSystemProps>;
5
+ export default FileSystem;
@@ -0,0 +1,3 @@
1
+ export interface FileSystemProps {
2
+ setParentState?: (file: File) => void;
3
+ }
@@ -1,6 +1,6 @@
1
1
  import type { SettingsOptions } from '.';
2
2
  export declare const useManageSettings: () => {
3
3
  host: "web" | "rhino" | "revit" | "sketchup";
4
- sendSettings: (settings: SettingsOptions) => import("./types").PanelMessageIn;
4
+ sendSettings: (uniqueId: string, settings: SettingsOptions) => import("./types").PanelMessageIn;
5
5
  getSettings: (key?: string) => any;
6
6
  };
@@ -0,0 +1,5 @@
1
+ import { PanelMessageOut } from './types';
2
+ export declare const usePollinationPanel: () => {
3
+ getFileBase64: (key?: any, accept?: any) => PanelMessageOut;
4
+ saveFileBase64: (key: string, file: File, subFolder: string, fileName: string) => Promise<PanelMessageOut>;
5
+ };
@@ -1,6 +1,7 @@
1
1
  import type { PanelMessageIn } from './types';
2
2
  export declare function checkDotNet(): boolean;
3
3
  export declare function checkRuby(): boolean;
4
+ export declare function checkPollinationPanel(): boolean;
4
5
  export declare function sendMessageDotNet(message: PanelMessageIn): PanelMessageIn;
5
6
  export declare function sendMessageRuby(message: PanelMessageIn): PanelMessageIn;
6
7
  export declare function getHost(key?: string, defaultValue?: 'web' | 'rhino' | 'revit' | 'sketchup'): 'web' | 'rhino' | 'revit' | 'sketchup';
@@ -37741,7 +37741,21 @@ var useArtifacts = function (owner, name, client) {
37741
37741
  };
37742
37742
  };
37743
37743
 
37744
+ /*
37745
+ * Deprecated
37746
+ */
37744
37747
  function checkDotNet() {
37748
+ checkPollinationPanel();
37749
+ return true;
37750
+ }
37751
+ /*
37752
+ * Deprecated
37753
+ */
37754
+ function checkRuby() {
37755
+ checkPollinationPanel();
37756
+ return true;
37757
+ }
37758
+ function checkPollinationPanel() {
37745
37759
  try {
37746
37760
  if (typeof window.parent.chrome === 'undefined') {
37747
37761
  console.error('[POLLINATION-DEBUG]: chrome not found.');
@@ -37762,24 +37776,31 @@ function checkDotNet() {
37762
37776
  console.error('[POLLINATION-DEBUG]: webview not found.');
37763
37777
  return false;
37764
37778
  }
37765
- return true;
37766
- }
37767
- function checkRuby() {
37768
37779
  try {
37769
- if (typeof window.sketchup === 'undefined') {
37770
- console.error('[POLLINATION-DEBUG]: sketchup not found.');
37780
+ if (typeof window.parent.chrome.webview.hostObjects === 'undefined') {
37781
+ console.error('[POLLINATION-DEBUG]: webview.hostObjects not found.');
37771
37782
  return false;
37772
37783
  }
37773
37784
  }
37774
- catch (_a) {
37775
- console.error('[POLLINATION-DEBUG]: sketchup not found.');
37785
+ catch (_c) {
37786
+ console.error('[POLLINATION-DEBUG]: webview.hostObjects not found.');
37787
+ return false;
37788
+ }
37789
+ try {
37790
+ if (typeof window.parent.chrome.webview.hostObjects.sync === 'undefined') {
37791
+ console.error('[POLLINATION-DEBUG]: webview.hostObjects.sync not found.');
37792
+ return false;
37793
+ }
37794
+ }
37795
+ catch (_d) {
37796
+ console.error('[POLLINATION-DEBUG]: webview.hostObjects.sync not found.');
37776
37797
  return false;
37777
37798
  }
37778
37799
  return true;
37779
37800
  }
37780
37801
  function sendMessageDotNet(message) {
37781
37802
  if (!checkDotNet())
37782
- return undefined;
37803
+ ;
37783
37804
  // const json = JSON.stringify(message)
37784
37805
  var json = message;
37785
37806
  if (typeof message.data !== 'string') {
@@ -37795,7 +37816,7 @@ function sendMessageDotNet(message) {
37795
37816
  }
37796
37817
  function sendMessageRuby(message) {
37797
37818
  if (!checkRuby())
37798
- return undefined;
37819
+ ;
37799
37820
  console.error('[POLLINATION-DEBUG]: sendMesssageRuby not yet implemented');
37800
37821
  return message;
37801
37822
  }
@@ -37828,9 +37849,65 @@ function formatBytes(bytes, decimals) {
37828
37849
  return "".concat(parseFloat((bytes / Math.pow(k, i)).toFixed(dm)), " ").concat(sizes[i]);
37829
37850
  }
37830
37851
 
37852
+ function blobToBase64(blob) {
37853
+ return __awaiter$1(this, void 0, void 0, function () {
37854
+ return __generator$1(this, function (_a) {
37855
+ return [2 /*return*/, new Promise(function (resolve, _) {
37856
+ var reader = new FileReader();
37857
+ reader.onloadend = function () {
37858
+ if (typeof reader.result !== 'string') {
37859
+ return;
37860
+ }
37861
+ resolve(btoa(reader.result));
37862
+ };
37863
+ reader.readAsText(blob);
37864
+ })];
37865
+ });
37866
+ });
37867
+ }
37868
+ var usePollinationPanel = function () {
37869
+ var panel = useMemo(function () {
37870
+ return checkPollinationPanel() ? window.parent.chrome.webview.hostObjects.sync.study : false;
37871
+ }, []);
37872
+ var saveFileBase64 = useCallback(function (key, file, subFolder, fileName) { return __awaiter$1(void 0, void 0, void 0, function () {
37873
+ var base64;
37874
+ return __generator$1(this, function (_a) {
37875
+ switch (_a.label) {
37876
+ case 0:
37877
+ if (!panel)
37878
+ return [2 /*return*/];
37879
+ return [4 /*yield*/, blobToBase64(file)];
37880
+ case 1:
37881
+ base64 = _a.sent();
37882
+ if (typeof base64 !== 'string') {
37883
+ console.error(base64);
37884
+ return [2 /*return*/, null];
37885
+ }
37886
+ return [2 /*return*/, panel.FromBase64ToFile(key, base64, subFolder, fileName)];
37887
+ }
37888
+ });
37889
+ }); }, [panel]);
37890
+ var getFileBase64 = useCallback(function (key, accept) {
37891
+ if (key === void 0) { key = performance.now().toString(); }
37892
+ if (accept === void 0) { accept = 'HBJSON|*.hbjson'; }
37893
+ if (!panel)
37894
+ return;
37895
+ return panel.GetArtifactAsBase64(key, accept);
37896
+ }, [panel]);
37897
+ return {
37898
+ getFileBase64: getFileBase64,
37899
+ saveFileBase64: saveFileBase64
37900
+ };
37901
+ };
37902
+
37903
+ var dayjs_min = createCommonjsModule(function (module, exports) {
37904
+ !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",D={};D[v]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return v;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(v=i),i||!r&&v},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var v=this.$locale().weekStart||0,D=(y<v?y+7:y)-v;return $(r?m-D:m+(6-D),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,v=O.m(this,M);return v=(l={},l[c]=v/12,l[f]=v,l[h]=v/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?v:O.a(v)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[v],w.Ls=D,w.p={},w}));
37905
+ });
37906
+
37831
37907
  var useCreateStudy = function (accountName, projectName, client) {
37832
37908
  var host = getHost();
37833
37909
  var uploadArtifact = useArtifacts(accountName, projectName, client).uploadArtifact;
37910
+ var saveFileBase64 = usePollinationPanel().saveFileBase64;
37834
37911
  // uploads all file inputs for cloud studies
37835
37912
  var processEntryCloud = useCallback(function (_a, input) {
37836
37913
  var name = _a[0], value = _a[1];
@@ -37908,18 +37985,19 @@ var useCreateStudy = function (accountName, projectName, client) {
37908
37985
  }
37909
37986
  // if the file is cloud hosted, or from CAD application - download / save
37910
37987
  if (value instanceof File) {
37911
- reject('File nputs to local simulations, including .hbjson models, must be provided using the local file selector.');
37912
- // resolve({
37913
- // name,
37914
- // type: 'JobPathArgument',
37915
- // source: {
37916
- // type: 'ProjectFolder',
37917
- // path: download(value)
37918
- // }
37919
- // })
37988
+ reject('File inputs to local simulations, including .hbjson models, must be provided using the local file selector.');
37989
+ resolve({
37990
+ name: name,
37991
+ type: 'JobPathArgument',
37992
+ source: {
37993
+ type: 'ProjectFolder',
37994
+ // @ts-ignore
37995
+ path: saveFileBase64('key', value, "".concat(dayjs_min().format('YYYY-DD-MMTHH_MM_SS')), value.file_name)
37996
+ }
37997
+ });
37920
37998
  }
37921
37999
  });
37922
- }, []);
38000
+ }, [saveFileBase64]);
37923
38001
  var createStudy = useCallback(function (_a, data, onSuccess) {
37924
38002
  var name = _a.name, recipe = _a.recipe, description = _a.description;
37925
38003
  if (!client || !name || !recipe || !data) {
@@ -37986,7 +38064,6 @@ var useCreateStudy = function (accountName, projectName, client) {
37986
38064
  LocalCPUNumber: localCPUCount,
37987
38065
  LocalRunFolder: localRunFolder
37988
38066
  };
37989
- console.log('jobInfo: ', jobInfo);
37990
38067
  response = sendMessageDotNet({
37991
38068
  action: 'AddStudy',
37992
38069
  data: jobInfo,
@@ -39892,7 +39969,7 @@ var useGetGeometry = function () {
39892
39969
  if (selection === void 0) { selection = false; }
39893
39970
  if (force === void 0) { force = false; }
39894
39971
  if (!checkDotNet())
39895
- return;
39972
+ ;
39896
39973
  var res = {
39897
39974
  data: null,
39898
39975
  identifier: null,
@@ -39956,7 +40033,7 @@ var useGetHbjson = function () {
39956
40033
  if (selection === void 0) { selection = false; }
39957
40034
  if (force === void 0) { force = false; }
39958
40035
  if (!checkDotNet())
39959
- return;
40036
+ ;
39960
40037
  var res = window.parent.chrome.webview
39961
40038
  .hostObjects.sync.hbjson.Get(key, selection);
39962
40039
  if (res) {
@@ -39965,7 +40042,7 @@ var useGetHbjson = function () {
39965
40042
  }, [setReturnValue]);
39966
40043
  var revitGetHbjson = useCallback(function () {
39967
40044
  if (!checkDotNet())
39968
- return;
40045
+ ;
39969
40046
  window.parent.chrome.webview.hostObjects.sync.hbjson.GetAsync();
39970
40047
  }, []);
39971
40048
  var getHbjson = useMemo(function () {
@@ -40121,13 +40198,13 @@ var useSendMessage = function () {
40121
40198
 
40122
40199
  var useManageSettings = function () {
40123
40200
  var _a = useSendMessage(), host = _a.host, sendMessage = _a.sendMessage;
40124
- var sendSettings = useCallback(function (settings) {
40125
- return sendMessage('AddSettings', { data: settings });
40201
+ var sendSettings = useCallback(function (uniqueId, settings) {
40202
+ return sendMessage('AddSettings', { uniqueId: uniqueId, data: settings });
40126
40203
  }, [sendMessage]);
40127
40204
  var getSettings = useCallback(function (key) {
40128
40205
  if (key === void 0) { key = performance.now().toString(); }
40129
40206
  if (!checkDotNet())
40130
- return;
40207
+ ;
40131
40208
  var settings;
40132
40209
  try {
40133
40210
  settings = window.parent.chrome.webview.hostObjects.sync.settings.GetModelSettings();
@@ -40178,10 +40255,6 @@ var useRunCommand = function (defaultKey) {
40178
40255
  };
40179
40256
  };
40180
40257
 
40181
- var dayjs_min = createCommonjsModule(function (module, exports) {
40182
- !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",D={};D[v]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return v;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(v=i),i||!r&&v},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var v=this.$locale().weekStart||0,D=(y<v?y+7:y)-v;return $(r?m-D:m+(6-D),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,v=O.m(this,M);return v=(l={},l[c]=v/12,l[f]=v,l[h]=v/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?v:O.a(v)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[v],w.Ls=D,w.p={},w}));
40183
- });
40184
-
40185
40258
  var duration = createCommonjsModule(function (module, exports) {
40186
40259
  !function(t,s){module.exports=s();}(commonjsGlobal,(function(){var t,s,n=1e3,i=6e4,e=36e5,r=864e5,o=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=31536e6,h=2592e6,a=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d={years:u,months:h,days:r,hours:e,minutes:i,seconds:n,milliseconds:1,weeks:6048e5},c=function(t){return t instanceof p},f=function(t,s,n){return new p(t,n,s.$l)},m=function(t){return s.p(t)+"s"},l=function(t){return t<0},$=function(t){return l(t)?Math.ceil(t):Math.floor(t)},y=function(t){return Math.abs(t)},g=function(t,s){return t?l(t)?{negative:!0,format:""+y(t)+s}:{negative:!1,format:""+t+s}:{negative:!1,format:""}},p=function(){function l(t,s,n){var i=this;if(this.$d={},this.$l=n,void 0===t&&(this.$ms=0,this.parseFromMilliseconds()),s)return f(t*d[m(s)],this);if("number"==typeof t)return this.$ms=t,this.parseFromMilliseconds(),this;if("object"==typeof t)return Object.keys(t).forEach((function(s){i.$d[m(s)]=t[s];})),this.calMilliseconds(),this;if("string"==typeof t){var e=t.match(a);if(e){var r=e.slice(2).map((function(t){return null!=t?Number(t):0}));return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var y=l.prototype;return y.calMilliseconds=function(){var t=this;this.$ms=Object.keys(this.$d).reduce((function(s,n){return s+(t.$d[n]||0)*d[n]}),0);},y.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=$(t/u),t%=u,this.$d.months=$(t/h),t%=h,this.$d.days=$(t/r),t%=r,this.$d.hours=$(t/e),t%=e,this.$d.minutes=$(t/i),t%=i,this.$d.seconds=$(t/n),t%=n,this.$d.milliseconds=t;},y.toISOString=function(){var t=g(this.$d.years,"Y"),s=g(this.$d.months,"M"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=g(n,"D"),e=g(this.$d.hours,"H"),r=g(this.$d.minutes,"M"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3);var u=g(o,"S"),h=t.negative||s.negative||i.negative||e.negative||r.negative||u.negative,a=e.format||r.format||u.format?"T":"",d=(h?"-":"")+"P"+t.format+s.format+i.format+a+e.format+r.format+u.format;return "P"===d||"-P"===d?"P0D":d},y.toJSON=function(){return this.toISOString()},y.format=function(t){var n=t||"YYYY-MM-DDTHH:mm:ss",i={Y:this.$d.years,YY:s.s(this.$d.years,2,"0"),YYYY:s.s(this.$d.years,4,"0"),M:this.$d.months,MM:s.s(this.$d.months,2,"0"),D:this.$d.days,DD:s.s(this.$d.days,2,"0"),H:this.$d.hours,HH:s.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:s.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:s.s(this.$d.seconds,2,"0"),SSS:s.s(this.$d.milliseconds,3,"0")};return n.replace(o,(function(t,s){return s||String(i[t])}))},y.as=function(t){return this.$ms/d[m(t)]},y.get=function(t){var s=this.$ms,n=m(t);return "milliseconds"===n?s%=1e3:s="weeks"===n?$(s/d[n]):this.$d[n],0===s?0:s},y.add=function(t,s,n){var i;return i=s?t*d[m(s)]:c(t)?t.$ms:f(t,this).$ms,f(this.$ms+i*(n?-1:1),this)},y.subtract=function(t,s){return this.add(t,s,!0)},y.locale=function(t){var s=this.clone();return s.$l=t,s},y.clone=function(){return f(this.$ms,this)},y.humanize=function(s){return t().add(this.$ms,"ms").locale(this.$l).fromNow(!s)},y.milliseconds=function(){return this.get("milliseconds")},y.asMilliseconds=function(){return this.as("milliseconds")},y.seconds=function(){return this.get("seconds")},y.asSeconds=function(){return this.as("seconds")},y.minutes=function(){return this.get("minutes")},y.asMinutes=function(){return this.as("minutes")},y.hours=function(){return this.get("hours")},y.asHours=function(){return this.as("hours")},y.days=function(){return this.get("days")},y.asDays=function(){return this.as("days")},y.weeks=function(){return this.get("weeks")},y.asWeeks=function(){return this.as("weeks")},y.months=function(){return this.get("months")},y.asMonths=function(){return this.as("months")},y.years=function(){return this.get("years")},y.asYears=function(){return this.as("years")},l}();return function(n,i,e){t=e,s=e().$utils(),e.duration=function(t,s){var n=e.locale();return f(t,{$l:n},s)},e.isDuration=c;var r=i.prototype.add,o=i.prototype.subtract;i.prototype.add=function(t,s){return c(t)&&(t=t.asMilliseconds()),r.bind(this)(t,s)},i.prototype.subtract=function(t,s){return c(t)&&(t=t.asMilliseconds()),o.bind(this)(t,s)};}}));
40187
40260
  });
@@ -40315,7 +40388,7 @@ var useSendHbjson = function () {
40315
40388
  var _a = useState({}), state = _a[0], setState = _a[1];
40316
40389
  var sendHbjson = useCallback(function (action, message) {
40317
40390
  if (!checkDotNet())
40318
- return;
40391
+ ;
40319
40392
  var response = sendMessageDotNet(__assign({ action: action }, message));
40320
40393
  setState(function (state) { return (__assign(__assign({}, state), { response: response })); });
40321
40394
  return response;
@@ -40654,7 +40727,7 @@ var SelectLocalArtifactNative = function (_a) {
40654
40727
  }, [defaultKey]);
40655
40728
  var handleSelectNative = useCallback(function () {
40656
40729
  if (!checkDotNet())
40657
- throw new Error('Use handleSelectNative from a Pollination CAD Plugin.');
40730
+ ;
40658
40731
  var res;
40659
40732
  try {
40660
40733
  if (mode === 'file') {
@@ -45400,7 +45473,7 @@ var RunCard = function (_a) {
45400
45473
  React__default.createElement("div", { style: {
45401
45474
  color: 'var(--slate10)',
45402
45475
  fontSize: '0.9rem'
45403
- } }, run ? dayjs_min(run.status.started_at).format('dddd[,] MMMM YYYY HH:mm:ss') : '--')),
45476
+ } }, run ? dayjs_min(run.status.started_at).format('dddd[,] MMMM DD[,] YYYY [at] HH:mm:ss') : '--')),
45404
45477
  React__default.createElement("div", { style: {
45405
45478
  display: 'flex',
45406
45479
  flexDirection: 'column',
@@ -46610,7 +46683,7 @@ var StudyCard = function (_a) {
46610
46683
  React__default.createElement("div", { style: {
46611
46684
  color: 'var(--slate10)',
46612
46685
  fontSize: '0.9rem'
46613
- } }, study ? dayjs_min(study.status.started_at).format('dddd[,] MMMM YYYY HH:mm:ss') : '--')),
46686
+ } }, study ? dayjs_min(study.status.started_at).format('dddd[,] MMMM DD[,] YYYY [at] HH:mm:ss') : '--')),
46614
46687
  React__default.createElement("div", { style: {
46615
46688
  display: 'flex',
46616
46689
  flexDirection: 'column',
@@ -46664,5 +46737,5 @@ var StudyCard = function (_a) {
46664
46737
  React__default.createElement(RunsList, { projectOwner: projectOwner, projectName: projectName, jobId: [study.id], subscribe: !_study.status.finished_at, client: client, authUser: authUser }))));
46665
46738
  };
46666
46739
 
46667
- export { APIClient, AuthUser, Avatar, Button, ComboBox, ComboFileSelector, ConditionalWrapper, ConfigureLocalRun, CreateStudy, Dropdown, FileInput, FormInput, GetGeometry, GetModel, InputDescription, Label, Logo, NumberInput, RadioList, RecipeInputsForm, RunCard, SelectAccount, SelectCloudArtifacts, SelectLocalArtifacts, SelectProject, SelectRecipe, SelectRun, SelectStudy, SendGeometry, SendModel, SendResults, SettingsButton, StudyCard, TextInput, Tooltip, checkDotNet, checkRuby, formatBytes, getDuration, getHost, getSummaryColor, recipeLinkFromSource, sendMessageDotNet, sendMessageRuby, statusMap, useAPIClient, useArtifacts, useCreateStudy, useGetGeometry, useGetHbjson, useHbjsontoVTK, useJobs, useManageSettings, useRunCommand, useRuns, useSendHbjson, useSendMessage };
46740
+ export { APIClient, AuthUser, Avatar, Button, ComboBox, ComboFileSelector, ConditionalWrapper, ConfigureLocalRun, CreateStudy, Dropdown, FileInput, FormInput, GetGeometry, GetModel, InputDescription, Label, Logo, NumberInput, RadioList, RecipeInputsForm, RunCard, SelectAccount, SelectCloudArtifacts, SelectLocalArtifacts, SelectProject, SelectRecipe, SelectRun, SelectStudy, SendGeometry, SendModel, SendResults, SettingsButton, StudyCard, TextInput, Tooltip, checkDotNet, checkPollinationPanel, checkRuby, formatBytes, getDuration, getHost, getSummaryColor, recipeLinkFromSource, sendMessageDotNet, sendMessageRuby, statusMap, useAPIClient, useArtifacts, useCreateStudy, useGetGeometry, useGetHbjson, useHbjsontoVTK, useJobs, useManageSettings, useRunCommand, useRuns, useSendHbjson, useSendMessage };
46668
46741
  //# sourceMappingURL=index.esm.js.map