@stlite/desktop 0.43.1 → 0.44.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.
Files changed (74) hide show
  1. package/bin/dump_artifacts.js +1 -1
  2. package/build/asset-manifest.json +40 -38
  3. package/build/index.html +1 -1
  4. package/build/static/js/1122.422f58fc.chunk.js +1 -0
  5. package/build/static/js/{144.2477d27a.chunk.js → 144.046792d9.chunk.js} +1 -1
  6. package/build/static/js/{1729.528431ca.chunk.js → 1729.d59ed152.chunk.js} +1 -1
  7. package/build/static/js/{1740.32a0c10e.chunk.js → 1740.2c71a97a.chunk.js} +1 -1
  8. package/build/static/js/{1839.a1fce0e6.chunk.js → 1839.0d0dcac8.chunk.js} +1 -1
  9. package/build/static/js/2372.844b5190.chunk.js +2 -0
  10. package/build/static/js/2372.844b5190.chunk.js.LICENSE.txt +10 -0
  11. package/build/static/js/2753.c27b6faa.chunk.js +1 -0
  12. package/build/static/js/2873.f5c04f3b.chunk.js +1 -0
  13. package/build/static/js/3208.55e0b2fa.chunk.js +1 -0
  14. package/build/static/js/{4021.16f5498a.chunk.js → 4021.ec2e87b0.chunk.js} +1 -1
  15. package/build/static/js/4482.a9238ad0.chunk.js +1 -0
  16. package/build/static/js/4494.6bb6fb20.chunk.js +1 -0
  17. package/build/static/js/4694.aa16aaee.chunk.js +1 -0
  18. package/build/static/js/4721.2185bda3.chunk.js +1 -0
  19. package/build/static/js/{4724.366489f9.chunk.js → 4724.374578aa.chunk.js} +1 -1
  20. package/build/static/js/4785.76a05d79.chunk.js +1 -0
  21. package/build/static/js/4831.391fe620.chunk.js +1 -0
  22. package/build/static/js/5299.beb80829.chunk.js +1 -0
  23. package/build/static/js/6093.209cd165.chunk.js +1 -0
  24. package/build/static/js/6134.b9e5b2db.chunk.js +1 -0
  25. package/build/static/js/6802.df955c77.chunk.js +1 -0
  26. package/build/static/js/698.116a166b.chunk.js +1 -0
  27. package/build/static/js/7125.afecc159.chunk.js +1 -0
  28. package/build/static/js/7579.ea965a43.chunk.js +1 -0
  29. package/build/static/js/7696.c9589682.chunk.js +1 -0
  30. package/build/static/js/8050.029f3dc8.chunk.js +1 -0
  31. package/build/static/js/8097.4837946f.chunk.js +2 -0
  32. package/build/static/js/8186.2f2e42e5.chunk.js +2 -0
  33. package/build/static/js/8186.2f2e42e5.chunk.js.LICENSE.txt +135 -0
  34. package/build/static/js/8850.6abc7336.chunk.js +1 -0
  35. package/build/static/js/{9166.d35e76c1.chunk.js → 9166.f234f6b4.chunk.js} +2 -2
  36. package/build/static/js/9311.7c7348b0.chunk.js +1 -0
  37. package/build/static/js/{5703.a68ecfdc.chunk.js → 9449.a2c361bb.chunk.js} +2 -2
  38. package/build/static/js/9699.df050cd6.chunk.js +1 -0
  39. package/build/static/js/9813.1821ef79.chunk.js +1 -0
  40. package/build/static/js/main.ca9c9d66.js +28 -0
  41. package/build/static/js/{main.94addb49.js.LICENSE.txt → main.ca9c9d66.js.LICENSE.txt} +0 -20
  42. package/package.json +5 -5
  43. package/build/static/css/7895.c24b25fa.chunk.css +0 -1
  44. package/build/static/js/1619.c039c65c.chunk.js +0 -1
  45. package/build/static/js/1687.a144d952.chunk.js +0 -1
  46. package/build/static/js/2873.cf145dcb.chunk.js +0 -1
  47. package/build/static/js/3185.d317b162.chunk.js +0 -1
  48. package/build/static/js/4232.b0bbe2e6.chunk.js +0 -2
  49. package/build/static/js/4232.b0bbe2e6.chunk.js.LICENSE.txt +0 -52
  50. package/build/static/js/4482.2f210b65.chunk.js +0 -1
  51. package/build/static/js/4494.c6ab91c6.chunk.js +0 -1
  52. package/build/static/js/4694.7e63f0ef.chunk.js +0 -1
  53. package/build/static/js/4785.3ac653c2.chunk.js +0 -1
  54. package/build/static/js/4831.3170175f.chunk.js +0 -1
  55. package/build/static/js/5037.03a99abb.chunk.js +0 -1
  56. package/build/static/js/5299.ad735cb8.chunk.js +0 -1
  57. package/build/static/js/5361.bc476229.chunk.js +0 -2
  58. package/build/static/js/6134.5e3e3f58.chunk.js +0 -1
  59. package/build/static/js/6802.ffb6887c.chunk.js +0 -1
  60. package/build/static/js/698.7dce549b.chunk.js +0 -1
  61. package/build/static/js/7125.21833215.chunk.js +0 -1
  62. package/build/static/js/7579.7b9cc9ee.chunk.js +0 -1
  63. package/build/static/js/7652.f436cbbf.chunk.js +0 -1
  64. package/build/static/js/7696.406d4ef7.chunk.js +0 -1
  65. package/build/static/js/7895.198c568c.chunk.js +0 -1
  66. package/build/static/js/9311.f444417e.chunk.js +0 -1
  67. package/build/static/js/9813.c894655a.chunk.js +0 -1
  68. package/build/static/js/main.94addb49.js +0 -28
  69. /package/build/static/css/{7652.c24b25fa.chunk.css → 8050.c24b25fa.chunk.css} +0 -0
  70. /package/build/static/css/{5703.1edfa457.chunk.css → 9449.1edfa457.chunk.css} +0 -0
  71. /package/build/static/css/{1619.7ce51b75.chunk.css → 9699.7ce51b75.chunk.css} +0 -0
  72. /package/build/static/js/{5361.bc476229.chunk.js.LICENSE.txt → 8097.4837946f.chunk.js.LICENSE.txt} +0 -0
  73. /package/build/static/js/{9166.d35e76c1.chunk.js.LICENSE.txt → 9166.f234f6b4.chunk.js.LICENSE.txt} +0 -0
  74. /package/build/static/js/{5703.a68ecfdc.chunk.js.LICENSE.txt → 9449.a2c361bb.chunk.js.LICENSE.txt} +0 -0
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var K=Object.create;var D=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var J=(e,t,i,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of M(t))!L.call(e,s)&&s!==i&&D(e,s,{get:()=>t[s],enumerable:!(a=I(t,s))||a.enumerable});return e};var d=(e,t,i)=>(i=e!=null?K(x(e)):{},J(t||!e||!e.__esModule?D(i,"default",{value:e,enumerable:!0}):i,e));var b=w(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.parseRequirementsTxt=void 0;function R(e){return e.split(`
3
- `).filter(t=>!t.startsWith("#")).map(t=>t.trim()).filter(t=>t!=="")}g.parseRequirementsTxt=R});var _=w(h=>{"use strict";Object.defineProperty(h,"__esModule",{value:!0});h.PromiseDelegate=void 0;var k=class{constructor(){this.promise=new Promise((t,i)=>{this.resolveInternal=t,this.rejectInternal=i})}resolve(t){this.resolveInternal(t)}reject(t){this.rejectInternal(t)}};h.PromiseDelegate=k});var O=w(p=>{"use strict";var E=p&&p.__createBinding||(Object.create?function(e,t,i,a){a===void 0&&(a=i);var s=Object.getOwnPropertyDescriptor(t,i);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,a,s)}:function(e,t,i,a){a===void 0&&(a=i),e[a]=t[i]}),q=p&&p.__exportStar||function(e,t){for(var i in e)i!=="default"&&!Object.prototype.hasOwnProperty.call(t,i)&&E(t,e,i)};Object.defineProperty(p,"__esModule",{value:!0});q(b(),p);q(_(),p)});var T=d(require("yargs")),j=require("yargs/helpers"),r=d(require("path")),n=d(require("fs/promises")),v=d(require("fs-extra")),m=d(require("node-fetch")),f=require("pyodide"),S=d(O());global.fetch=m.default;function B(e){return`https://cdn.jsdelivr.net/pyodide/v${f.version}/full/${e}`}async function C(e){console.info("Copy the build directory (the bare built app files) to this directory...");let t=r.default.resolve(__dirname,"../build");if(!(await n.default.stat(t)).isDirectory())throw new Error(`The source ${t} does not exist.`);if(t===e.copyTo){console.warn(`sourceDir == destDir (${t}). Are you in the development environment? Skip copying the directory.`);return}if(e.keepOld)try{await n.default.access(e.copyTo),console.info(`${e.copyTo} already exists. Use it and skip copying.`);return}catch{throw new Error(`${e.copyTo} does not exist even though the \`keepOld\` option is specified`)}console.log(`Copy ${t} to ${e.copyTo}`),await n.default.rm(e.copyTo,{recursive:!0,force:!0}),await v.default.copy(t,e.copyTo)}async function A(e){if(e.requirements.length===0)return[];let t=await(0,f.loadPyodide)();return await W(t,{useLocalKernelWheels:e.useLocalKernelWheels,requirements:e.requirements}),Object.entries(t.loadedPackages).filter(([,i])=>i==="default channel").map(([i])=>i)}async function F(){let e=B("repodata.json");return console.log(`Load the Pyodide repodata.json from ${e}`),(await(await(0,m.default)(e)).json()).packages}async function $(e,t){console.log(`Preparing the local wheel ${t}`);let i=await n.default.readFile(t),a="/tmp/"+r.default.basename(t);e.FS.writeFile(a,i);let s=`emfs:${a}`;return console.log(`The local wheel ${t} is prepared as ${s}`),s}async function W(e,t){await e.loadPackage(["micropip"]);let i=e.pyimport("micropip"),a=[...t.requirements];if(t.useLocalKernelWheels){let s=r.default.dirname(require.resolve("@stlite/kernel")),o=r.default.resolve(s,"../py"),l=await $(e,r.default.join(o,"stlite-server/dist/stlite_server-0.1.0-py3-none-any.whl"));a.push(l);let c=await $(e,r.default.join(o,"streamlit/lib/dist/streamlit-1.27.0-cp311-none-any.whl"));a.push(c)}else{let o=require(r.default.resolve(__dirname,"../package.json")).version,l=`https://data.jsdelivr.com/v1/package/npm/@stlite/kernel@${o}/flat`,P=(await(await(0,m.default)(l)).json()).files.filter(y=>y.name.endsWith(".whl")).map(y=>`https://cdn.jsdelivr.net/npm/@stlite/kernel@${o}${y.name}`);console.log("Kernel wheels:",P),a.push(...P)}console.log("Install the packages:",a),await i.install.callKwargs(a,{keep_going:!0})}async function H(e){console.info("Create the site-packages snapshot file...");let t=await(0,f.loadPyodide)();await t.loadPackage(["micropip"]);let i=t.pyimport("micropip"),a=await F(),s=[];e.usedBuiltinPackages.length>0&&(console.log("Mocking builtin packages so that they will not be included in the site-packages snapshot because these will be installed from the vendored wheel files at runtime..."),e.usedBuiltinPackages.forEach(c=>{let u=a[c];if(u==null)throw new Error(`Package ${c} is not found in the lock file.`);console.log(`Mock ${u.name} ${u.version}`),i.add_mock_package(u.name,u.version),s.push(u.name)})),console.log(`Install the requirements ${JSON.stringify(e.requirements)}`),await W(t,{useLocalKernelWheels:e.useLocalKernelWheels,requirements:e.requirements}),console.log("Remove the mocked packages",s),s.forEach(c=>i.remove_mock_package(c)),console.log("Archive the site-packages director(y|ies)");let o="/tmp/site-packages-snapshot.tar.gz";await t.runPythonAsync(`
3
+ `).filter(t=>!t.startsWith("#")).map(t=>t.trim()).filter(t=>t!=="")}g.parseRequirementsTxt=R});var _=w(h=>{"use strict";Object.defineProperty(h,"__esModule",{value:!0});h.PromiseDelegate=void 0;var k=class{constructor(){this.promise=new Promise((t,i)=>{this.resolveInternal=t,this.rejectInternal=i})}resolve(t){this.resolveInternal(t)}reject(t){this.rejectInternal(t)}};h.PromiseDelegate=k});var O=w(p=>{"use strict";var E=p&&p.__createBinding||(Object.create?function(e,t,i,a){a===void 0&&(a=i);var s=Object.getOwnPropertyDescriptor(t,i);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,a,s)}:function(e,t,i,a){a===void 0&&(a=i),e[a]=t[i]}),q=p&&p.__exportStar||function(e,t){for(var i in e)i!=="default"&&!Object.prototype.hasOwnProperty.call(t,i)&&E(t,e,i)};Object.defineProperty(p,"__esModule",{value:!0});q(b(),p);q(_(),p)});var T=d(require("yargs")),j=require("yargs/helpers"),r=d(require("path")),n=d(require("fs/promises")),v=d(require("fs-extra")),m=d(require("node-fetch")),f=require("pyodide"),S=d(O());global.fetch=m.default;function B(e){return`https://cdn.jsdelivr.net/pyodide/v${f.version}/full/${e}`}async function C(e){console.info("Copy the build directory (the bare built app files) to this directory...");let t=r.default.resolve(__dirname,"../build");if(!(await n.default.stat(t)).isDirectory())throw new Error(`The source ${t} does not exist.`);if(t===e.copyTo){console.warn(`sourceDir == destDir (${t}). Are you in the development environment? Skip copying the directory.`);return}if(e.keepOld)try{await n.default.access(e.copyTo),console.info(`${e.copyTo} already exists. Use it and skip copying.`);return}catch{throw new Error(`${e.copyTo} does not exist even though the \`keepOld\` option is specified`)}console.log(`Copy ${t} to ${e.copyTo}`),await n.default.rm(e.copyTo,{recursive:!0,force:!0}),await v.default.copy(t,e.copyTo)}async function A(e){if(e.requirements.length===0)return[];let t=await(0,f.loadPyodide)();return await W(t,{useLocalKernelWheels:e.useLocalKernelWheels,requirements:e.requirements}),Object.entries(t.loadedPackages).filter(([,i])=>i==="default channel").map(([i])=>i)}async function F(){let e=B("repodata.json");return console.log(`Load the Pyodide repodata.json from ${e}`),(await(await(0,m.default)(e)).json()).packages}async function $(e,t){console.log(`Preparing the local wheel ${t}`);let i=await n.default.readFile(t),a="/tmp/"+r.default.basename(t);e.FS.writeFile(a,i);let s=`emfs:${a}`;return console.log(`The local wheel ${t} is prepared as ${s}`),s}async function W(e,t){await e.loadPackage(["micropip"]);let i=e.pyimport("micropip"),a=[...t.requirements];if(t.useLocalKernelWheels){let s=r.default.dirname(require.resolve("@stlite/kernel")),o=r.default.resolve(s,"../py"),l=await $(e,r.default.join(o,"stlite-server/dist/stlite_server-0.1.0-py3-none-any.whl"));a.push(l);let c=await $(e,r.default.join(o,"streamlit/lib/dist/streamlit-1.30.0-cp311-none-any.whl"));a.push(c)}else{let o=require(r.default.resolve(__dirname,"../package.json")).version,l=`https://data.jsdelivr.com/v1/package/npm/@stlite/kernel@${o}/flat`,P=(await(await(0,m.default)(l)).json()).files.filter(y=>y.name.endsWith(".whl")).map(y=>`https://cdn.jsdelivr.net/npm/@stlite/kernel@${o}${y.name}`);console.log("Kernel wheels:",P),a.push(...P)}console.log("Install the packages:",a),await i.install.callKwargs(a,{keep_going:!0})}async function H(e){console.info("Create the site-packages snapshot file...");let t=await(0,f.loadPyodide)();await t.loadPackage(["micropip"]);let i=t.pyimport("micropip"),a=await F(),s=[];e.usedBuiltinPackages.length>0&&(console.log("Mocking builtin packages so that they will not be included in the site-packages snapshot because these will be installed from the vendored wheel files at runtime..."),e.usedBuiltinPackages.forEach(c=>{let u=a[c];if(u==null)throw new Error(`Package ${c} is not found in the lock file.`);console.log(`Mock ${u.name} ${u.version}`),i.add_mock_package(u.name,u.version),s.push(u.name)})),console.log(`Install the requirements ${JSON.stringify(e.requirements)}`),await W(t,{useLocalKernelWheels:e.useLocalKernelWheels,requirements:e.requirements}),console.log("Remove the mocked packages",s),s.forEach(c=>i.remove_mock_package(c)),console.log("Archive the site-packages director(y|ies)");let o="/tmp/site-packages-snapshot.tar.gz";await t.runPythonAsync(`
4
4
  import os
5
5
  import tarfile
6
6
  import site
@@ -1,66 +1,68 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "/static/css/main.fb5f4d99.css",
4
- "main.js": "/static/js/main.94addb49.js",
4
+ "main.js": "/static/js/main.ca9c9d66.js",
5
5
  "static/js/7332.cb5400eb.chunk.js": "/static/js/7332.cb5400eb.chunk.js",
6
6
  "static/js/4994.551c87ac.chunk.js": "/static/js/4994.551c87ac.chunk.js",
7
7
  "static/js/3685.c65c1e48.chunk.js": "/static/js/3685.c65c1e48.chunk.js",
8
- "static/js/4785.3ac653c2.chunk.js": "/static/js/4785.3ac653c2.chunk.js",
9
- "static/js/5299.ad735cb8.chunk.js": "/static/js/5299.ad735cb8.chunk.js",
10
- "static/js/4482.2f210b65.chunk.js": "/static/js/4482.2f210b65.chunk.js",
11
- "static/css/1619.7ce51b75.chunk.css": "/static/css/1619.7ce51b75.chunk.css",
12
- "static/js/1619.c039c65c.chunk.js": "/static/js/1619.c039c65c.chunk.js",
13
- "static/css/7652.c24b25fa.chunk.css": "/static/css/7652.c24b25fa.chunk.css",
14
- "static/js/7652.f436cbbf.chunk.js": "/static/js/7652.f436cbbf.chunk.js",
15
- "static/js/4021.16f5498a.chunk.js": "/static/js/4021.16f5498a.chunk.js",
16
- "static/js/4232.b0bbe2e6.chunk.js": "/static/js/4232.b0bbe2e6.chunk.js",
17
- "static/js/1687.a144d952.chunk.js": "/static/js/1687.a144d952.chunk.js",
18
- "static/js/5037.03a99abb.chunk.js": "/static/js/5037.03a99abb.chunk.js",
19
- "static/js/6802.ffb6887c.chunk.js": "/static/js/6802.ffb6887c.chunk.js",
20
- "static/js/9311.f444417e.chunk.js": "/static/js/9311.f444417e.chunk.js",
21
- "static/js/144.2477d27a.chunk.js": "/static/js/144.2477d27a.chunk.js",
8
+ "static/js/4785.76a05d79.chunk.js": "/static/js/4785.76a05d79.chunk.js",
9
+ "static/js/5299.beb80829.chunk.js": "/static/js/5299.beb80829.chunk.js",
10
+ "static/js/4482.a9238ad0.chunk.js": "/static/js/4482.a9238ad0.chunk.js",
11
+ "static/css/9699.7ce51b75.chunk.css": "/static/css/9699.7ce51b75.chunk.css",
12
+ "static/js/9699.df050cd6.chunk.js": "/static/js/9699.df050cd6.chunk.js",
13
+ "static/css/8050.c24b25fa.chunk.css": "/static/css/8050.c24b25fa.chunk.css",
14
+ "static/js/8050.029f3dc8.chunk.js": "/static/js/8050.029f3dc8.chunk.js",
15
+ "static/js/4021.ec2e87b0.chunk.js": "/static/js/4021.ec2e87b0.chunk.js",
16
+ "static/js/8186.2f2e42e5.chunk.js": "/static/js/8186.2f2e42e5.chunk.js",
17
+ "static/js/1122.422f58fc.chunk.js": "/static/js/1122.422f58fc.chunk.js",
18
+ "static/js/6802.df955c77.chunk.js": "/static/js/6802.df955c77.chunk.js",
19
+ "static/js/9311.7c7348b0.chunk.js": "/static/js/9311.7c7348b0.chunk.js",
20
+ "static/js/144.046792d9.chunk.js": "/static/js/144.046792d9.chunk.js",
22
21
  "static/js/2940.dd2240b9.chunk.js": "/static/js/2940.dd2240b9.chunk.js",
23
- "static/js/2873.cf145dcb.chunk.js": "/static/js/2873.cf145dcb.chunk.js",
24
- "static/css/7895.c24b25fa.chunk.css": "/static/css/7895.c24b25fa.chunk.css",
25
- "static/js/7895.198c568c.chunk.js": "/static/js/7895.198c568c.chunk.js",
26
- "static/js/6134.5e3e3f58.chunk.js": "/static/js/6134.5e3e3f58.chunk.js",
22
+ "static/js/2873.f5c04f3b.chunk.js": "/static/js/2873.f5c04f3b.chunk.js",
23
+ "static/js/6134.b9e5b2db.chunk.js": "/static/js/6134.b9e5b2db.chunk.js",
27
24
  "static/js/1189.71b89117.chunk.js": "/static/js/1189.71b89117.chunk.js",
28
- "static/js/1740.32a0c10e.chunk.js": "/static/js/1740.32a0c10e.chunk.js",
29
- "static/js/698.7dce549b.chunk.js": "/static/js/698.7dce549b.chunk.js",
30
- "static/js/4724.366489f9.chunk.js": "/static/js/4724.366489f9.chunk.js",
31
- "static/js/1729.528431ca.chunk.js": "/static/js/1729.528431ca.chunk.js",
25
+ "static/js/1740.2c71a97a.chunk.js": "/static/js/1740.2c71a97a.chunk.js",
26
+ "static/js/698.116a166b.chunk.js": "/static/js/698.116a166b.chunk.js",
27
+ "static/js/4724.374578aa.chunk.js": "/static/js/4724.374578aa.chunk.js",
28
+ "static/js/1729.d59ed152.chunk.js": "/static/js/1729.d59ed152.chunk.js",
32
29
  "static/js/1261.242b7386.chunk.js": "/static/js/1261.242b7386.chunk.js",
33
- "static/js/4494.c6ab91c6.chunk.js": "/static/js/4494.c6ab91c6.chunk.js",
34
- "static/js/9813.c894655a.chunk.js": "/static/js/9813.c894655a.chunk.js",
35
- "static/js/4694.7e63f0ef.chunk.js": "/static/js/4694.7e63f0ef.chunk.js",
36
- "static/js/7579.7b9cc9ee.chunk.js": "/static/js/7579.7b9cc9ee.chunk.js",
30
+ "static/js/4494.6bb6fb20.chunk.js": "/static/js/4494.6bb6fb20.chunk.js",
31
+ "static/js/9813.1821ef79.chunk.js": "/static/js/9813.1821ef79.chunk.js",
32
+ "static/js/4694.aa16aaee.chunk.js": "/static/js/4694.aa16aaee.chunk.js",
33
+ "static/js/7579.ea965a43.chunk.js": "/static/js/7579.ea965a43.chunk.js",
37
34
  "static/js/2448.e6f85eda.chunk.js": "/static/js/2448.e6f85eda.chunk.js",
38
35
  "static/js/8801.77babe65.chunk.js": "/static/js/8801.77babe65.chunk.js",
39
- "static/js/7696.406d4ef7.chunk.js": "/static/js/7696.406d4ef7.chunk.js",
40
- "static/js/7125.21833215.chunk.js": "/static/js/7125.21833215.chunk.js",
36
+ "static/js/7696.c9589682.chunk.js": "/static/js/7696.c9589682.chunk.js",
37
+ "static/js/7125.afecc159.chunk.js": "/static/js/7125.afecc159.chunk.js",
41
38
  "static/js/2385.2cbc4e3c.chunk.js": "/static/js/2385.2cbc4e3c.chunk.js",
42
39
  "static/js/9005.87bae37e.chunk.js": "/static/js/9005.87bae37e.chunk.js",
43
40
  "static/js/1046.ea522608.chunk.js": "/static/js/1046.ea522608.chunk.js",
44
- "static/js/4831.3170175f.chunk.js": "/static/js/4831.3170175f.chunk.js",
41
+ "static/js/4831.391fe620.chunk.js": "/static/js/4831.391fe620.chunk.js",
45
42
  "static/js/790.4b5acd65.chunk.js": "/static/js/790.4b5acd65.chunk.js",
43
+ "static/js/2753.c27b6faa.chunk.js": "/static/js/2753.c27b6faa.chunk.js",
44
+ "static/js/8850.6abc7336.chunk.js": "/static/js/8850.6abc7336.chunk.js",
45
+ "static/js/3208.55e0b2fa.chunk.js": "/static/js/3208.55e0b2fa.chunk.js",
46
46
  "static/js/4949.391c96be.chunk.js": "/static/js/4949.391c96be.chunk.js",
47
+ "static/js/4721.2185bda3.chunk.js": "/static/js/4721.2185bda3.chunk.js",
48
+ "static/js/6093.209cd165.chunk.js": "/static/js/6093.209cd165.chunk.js",
47
49
  "static/js/7135.57023452.chunk.js": "/static/js/7135.57023452.chunk.js",
48
50
  "static/js/6449.ec4e1d8e.chunk.js": "/static/js/6449.ec4e1d8e.chunk.js",
51
+ "static/js/1839.0d0dcac8.chunk.js": "/static/js/1839.0d0dcac8.chunk.js",
49
52
  "static/js/2909.783348bb.chunk.js": "/static/js/2909.783348bb.chunk.js",
50
- "static/js/5361.bc476229.chunk.js": "/static/js/5361.bc476229.chunk.js",
51
- "static/js/1839.a1fce0e6.chunk.js": "/static/js/1839.a1fce0e6.chunk.js",
52
- "static/css/5703.1edfa457.chunk.css": "/static/css/5703.1edfa457.chunk.css",
53
- "static/js/5703.a68ecfdc.chunk.js": "/static/js/5703.a68ecfdc.chunk.js",
53
+ "static/css/9449.1edfa457.chunk.css": "/static/css/9449.1edfa457.chunk.css",
54
+ "static/js/9449.a2c361bb.chunk.js": "/static/js/9449.a2c361bb.chunk.js",
55
+ "static/js/8097.4837946f.chunk.js": "/static/js/8097.4837946f.chunk.js",
54
56
  "static/js/1579.30acb4ad.chunk.js": "/static/js/1579.30acb4ad.chunk.js",
55
- "static/js/3185.d317b162.chunk.js": "/static/js/3185.d317b162.chunk.js",
57
+ "static/js/2372.844b5190.chunk.js": "/static/js/2372.844b5190.chunk.js",
56
58
  "static/js/865.143ae622.chunk.js": "/static/js/865.143ae622.chunk.js",
57
59
  "static/js/9320.14465db9.chunk.js": "/static/js/9320.14465db9.chunk.js",
58
60
  "static/js/142.dbf9ec20.chunk.js": "/static/js/142.dbf9ec20.chunk.js",
59
61
  "static/js/6865.12e417bf.chunk.js": "/static/js/6865.12e417bf.chunk.js",
60
- "static/js/9166.d35e76c1.chunk.js": "/static/js/9166.d35e76c1.chunk.js",
62
+ "static/js/9166.f234f6b4.chunk.js": "/static/js/9166.f234f6b4.chunk.js",
61
63
  "static/js/6679.f4ee1d77.chunk.js": "/static/js/6679.f4ee1d77.chunk.js",
62
64
  "module.wasm": "/c43e2f2e6b6fd378c8e1.module.wasm",
63
- "pypi/streamlit-1.27.0-cp311-none-any.whl": "/pypi/streamlit-1.27.0-cp311-none-any.whl",
65
+ "pypi/streamlit-1.30.0-cp311-none-any.whl": "/pypi/streamlit-1.30.0-cp311-none-any.whl",
64
66
  "static/media/index.cjs": "/static/media/index.c05687ef19f5bac24939.cjs",
65
67
  "static/media/fireworks.gif": "/static/media/fireworks.0906f02ea43f1018a6d2.gif",
66
68
  "static/media/flake-2.png": "/static/media/flake-2.e3f07d06933dd0e84c24.png",
@@ -159,6 +161,6 @@
159
161
  },
160
162
  "entrypoints": [
161
163
  "static/css/main.fb5f4d99.css",
162
- "static/js/main.94addb49.js"
164
+ "static/js/main.ca9c9d66.js"
163
165
  ]
164
166
  }
package/build/index.html CHANGED
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>stlite</title><script defer="defer" src="/static/js/main.94addb49.js"></script><link href="/static/css/main.fb5f4d99.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>stlite</title><script defer="defer" src="/static/js/main.ca9c9d66.js"></script><link href="/static/css/main.fb5f4d99.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
@@ -0,0 +1 @@
1
+ "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[1122],{21122:(t,e,i)=>{i.r(e),i.d(e,{default:()=>L});var o=i(5057),s=i(59663),n=i(41656),a=i(50482),r=i.n(a),h=i(87333),c=i(47206),l=i(96601),p=i(72212),d=i(80552),m=i(13012),g=i(65815),u=i(50256),w=i(98899),x=i(31324),b=i(719),k=i(50651),S=i(64327),y=i(56129),v=i.n(y),j=i(87672),T=i(96266);const f=t=>{let{error:e,width:i,deltaType:o}=t;return e instanceof J?(0,T.jsx)(j.Z,{width:i,name:"No Mapbox token provided",message:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("p",{children:["To use ",(0,T.jsxs)("code",{children:["st.",o]})," or ",(0,T.jsx)("code",{children:"st.map"})," you need to set up a Mapbox access token."]}),(0,T.jsxs)("p",{children:["To get a token, create an account at"," ",(0,T.jsx)("a",{href:"https://mapbox.com",children:"https://mapbox.com"}),". It's free for moderate usage levels!"]}),(0,T.jsxs)("p",{children:["Once you have a token, just set it using the Streamlit config option ",(0,T.jsx)("code",{children:"mapbox.token"})," and don't forget to restart your Streamlit server at this point if it's still running, then reload this tab."]}),(0,T.jsxs)("p",{children:["See"," ",(0,T.jsx)("a",{href:"https://docs.streamlit.io/library/advanced-features/configuration#view-all-configuration-options",children:"our documentation"})," ","for more info on how to set config options."]})]})}):e instanceof Z?(0,T.jsx)(j.Z,{width:i,name:"Error fetching Streamlit Mapbox token",message:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("p",{children:"This app requires an internet connection."}),(0,T.jsx)("p",{children:"Please check your connection and try again."}),(0,T.jsxs)("p",{children:["If you think this is a bug, please file bug report"," ",(0,T.jsx)("a",{href:"https://github.com/streamlit/streamlit/issues/new/choose",children:"here"}),"."]})]})}):(0,T.jsx)(j.Z,{width:i,name:"Error fetching Streamlit Mapbox token",message:e.message})};var V=i(51673),C=i(30147),F=i(31808);class J extends Error{}class Z extends Error{}const E="https://data.streamlit.io/tokens.json",z="mapbox",M=t=>e=>{class i extends o.PureComponent{constructor(i){super(i),this.initMapboxToken=async()=>{try{const t=await V.Z.get(E),{[z]:e}=t.data;if(!e)throw new Error("Missing token ".concat(z));this.setState({mapboxToken:e,isFetching:!1})}catch(t){const e=(0,S.b)(t);throw this.setState({mapboxTokenError:e,isFetching:!1}),new Z("".concat(e.message," (").concat(E,")"))}},this.render=()=>{const{mapboxToken:i,mapboxTokenError:o,isFetching:s}=this.state,{width:n}=this.props;return o?(0,T.jsx)(f,{width:n,error:o,deltaType:t}):s?(0,T.jsx)(C.O,{}):(0,T.jsx)(e,{...this.props,mapboxToken:i,width:n})},this.state={isFetching:!0,mapboxToken:void 0,mapboxTokenError:void 0}}componentDidMount(){const t=this.props.element.mapboxToken||this.context.libConfig.mapboxToken;t?this.setState({mapboxToken:t,isFetching:!1}):this.initMapboxToken()}}return i.displayName="withMapboxToken(".concat(e.displayName||e.name,")"),i.contextType=F.E,v()(i,e)};var D=i(82160);const I=(0,D.Z)("div",{target:"e1az0zs51"})((t=>{let{width:e,height:i,theme:o}=t;return{marginTop:o.spacing.sm,position:"relative",height:i,width:e}}),""),O=(0,D.Z)("div",{target:"e1az0zs50"})((t=>{let{theme:e}=t;return{position:"absolute",right:"2.625rem",top:e.spacing.md,zIndex:1,"button:not(:disabled)":{background:e.colors.bgColor,"& + button":{borderTopColor:e.colors.secondaryBg},"& span":{filter:(0,l.Iy)(e)?"":"invert(100%)"}}}}),"");i(20512);const P={classes:{...p,...g,...m,...u}};(0,b.fh)([w.w,x.E]);const N=new d.Z({configuration:P});class _ extends o.PureComponent{constructor(){super(...arguments),this.state={viewState:{bearing:0,pitch:0,zoom:11},initialized:!1,initialViewState:{},id:void 0,pydeckJson:void 0,isFullScreen:!1,isLightTheme:(0,l.Iy)(this.props.theme)},this.componentDidMount=()=>{this.setState({initialized:!0})},this.createTooltip=t=>{const{element:e}=this.props;if(!t||!t.object||!e.tooltip)return!1;const i=n.Z.parse(e.tooltip);return i.html?i.html=this.interpolate(t,i.html):i.text=this.interpolate(t,i.text),i},this.interpolate=(t,e)=>{const i=e.match(/{(.*?)}/g);return i&&i.forEach((i=>{const o=i.substring(1,i.length-1);t.object.hasOwnProperty(o)&&(e=e.replace(i,t.object[o]))})),e},this.onViewStateChange=t=>{let{viewState:e}=t;this.setState({viewState:e})}}static getDerivedStateFromProps(t,e){const i=_.getDeckObject(t,e);if(!r()(i.initialViewState,e.initialViewState)){const t=Object.keys(i.initialViewState).reduce(((t,o)=>i.initialViewState[o]===e.initialViewState[o]?t:{...t,[o]:i.initialViewState[o]}),{});return{viewState:{...e.viewState,...t},initialViewState:i.initialViewState}}return null}render(){const t=_.getDeckObject(this.props,this.state),{viewState:e}=this.state;return(0,T.jsx)(I,{className:"stDeckGlJsonChart",width:t.initialViewState.width,height:t.initialViewState.height,"data-testid":"stDeckGlJsonChart",children:(0,T.jsxs)(s.Z,{viewState:e,onViewStateChange:this.onViewStateChange,height:t.initialViewState.height,width:t.initialViewState.width,layers:this.state.initialized?t.layers:[],getTooltip:this.createTooltip,ContextProvider:h.X$.Provider,controller:!0,children:[(0,T.jsx)(h.Z3,{height:t.initialViewState.height,width:t.initialViewState.width,mapStyle:t.mapStyle&&("string"===typeof t.mapStyle?t.mapStyle:t.mapStyle[0]),mapboxApiAccessToken:this.props.element.mapboxToken||this.props.mapboxToken}),(0,T.jsx)(O,{children:(0,T.jsx)(h.Pv,{className:"zoomButton",showCompass:!1})})]})})}}_.getDeckObject=(t,e)=>{var i,o;const{element:s,width:a,height:r,theme:h,isFullScreen:c}=t,p=null!==c&&void 0!==c&&c;var d,m;(s.id===e.id&&e.isFullScreen===p&&e.isLightTheme===(0,l.Iy)(h)||(e.pydeckJson=n.Z.parse(s.json),e.id=s.id),null!==(i=e.pydeckJson)&&void 0!==i&&i.mapStyle||(e.pydeckJson.mapStyle="mapbox://styles/mapbox/".concat((0,l.Iy)(h)?"light":"dark","-v9")),c)?Object.assign(null===(d=e.pydeckJson)||void 0===d?void 0:d.initialViewState,{width:a,height:r}):(null!==(m=e.pydeckJson)&&void 0!==m&&null!==(m=m.initialViewState)&&void 0!==m&&m.height||(e.pydeckJson.initialViewState.height=500),s.useContainerWidth&&(e.pydeckJson.initialViewState.width=a));return e.isFullScreen=c,e.isLightTheme=(0,l.Iy)(h),null===(o=e.pydeckJson)||void 0===o||delete o.views,N.convert(e.pydeckJson)};const L=(0,c.b)(M("st.pydeck_chart")((0,k.Z)(_)))}}]);
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[144],{10144:(t,i,e)=>{e.r(i),e.d(i,{default:()=>h});e(5057);var n=e(70800),o=e(19954),l=e(82160);const r=(0,l.Z)("div",{target:"e115fcil2"})((t=>{let{theme:i}=t;return{display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:i.spacing.lg}}),""),a=(0,l.Z)("div",{target:"e115fcil1"})((()=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0})),""),d=(0,l.Z)("div",{target:"e115fcil0"})((t=>{let{theme:i}=t;return{fontFamily:i.genericFonts.bodyFont,fontSize:i.fontSizes.sm,color:i.colors.fadedText60,textAlign:"center",marginTop:i.spacing.xs,wordWrap:"break-word",padding:"0.125rem"}}),"");var s=e(96266),c=function(t){return t[t.OriginalWidth=-1]="OriginalWidth",t[t.ColumnWidth=-2]="ColumnWidth",t[t.AutoWidth=-3]="AutoWidth",t}(c||{});const h=(0,n.Z)((function(t){let{width:i,isFullScreen:e,element:n,height:l,endpoints:h}=t;const u=(0,o.$R)(n.imgs);let g;const f=n.width;if(f===c.OriginalWidth||f===c.AutoWidth)g=void 0;else if(f===c.ColumnWidth)g=i;else{if(!(f>0))throw Error("Invalid image width: ".concat(f));g=f}const p={};return l&&e?(p.maxHeight=l,p["object-fit"]="contain"):(p.width=g,f===c.AutoWidth&&(p.maxWidth="100%")),(0,s.jsx)(r,{style:{width:i},children:u.map(((t,i)=>{const e=t;return(0,s.jsxs)(a,{"data-testid":"stImage",children:[(0,s.jsx)("img",{style:p,src:h.buildMediaURL(e.url),alt:i.toString()}),e.caption&&(0,s.jsx)(d,{"data-testid":"caption",style:p,children:" ".concat(e.caption," ")})]},i)}))})}))}}]);
1
+ "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[144],{10144:(t,i,e)=>{e.r(i),e.d(i,{default:()=>h});e(5057);var n=e(50651),o=e(70442),l=e(82160);const r=(0,l.Z)("div",{target:"e115fcil2"})((t=>{let{theme:i}=t;return{display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:i.spacing.lg}}),""),a=(0,l.Z)("div",{target:"e115fcil1"})((()=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0})),""),d=(0,l.Z)("div",{target:"e115fcil0"})((t=>{let{theme:i}=t;return{fontFamily:i.genericFonts.bodyFont,fontSize:i.fontSizes.sm,color:i.colors.fadedText60,textAlign:"center",marginTop:i.spacing.xs,wordWrap:"break-word",padding:"0.125rem"}}),"");var s=e(96266),c=function(t){return t[t.OriginalWidth=-1]="OriginalWidth",t[t.ColumnWidth=-2]="ColumnWidth",t[t.AutoWidth=-3]="AutoWidth",t}(c||{});const h=(0,n.Z)((function(t){let{width:i,isFullScreen:e,element:n,height:l,endpoints:h}=t;const g=(0,o.$R)(n.imgs);let u;const f=n.width;if(f===c.OriginalWidth||f===c.AutoWidth)u=void 0;else if(f===c.ColumnWidth)u=i;else{if(!(f>0))throw Error("Invalid image width: ".concat(f));u=f}const m={};return l&&e?(m.maxHeight=l,m["object-fit"]="contain"):(m.width=u,f===c.AutoWidth&&(m.maxWidth="100%")),(0,s.jsx)(r,{style:{width:i},children:g.map(((t,i)=>{const e=t;return(0,s.jsxs)(a,{"data-testid":"stImage",children:[(0,s.jsx)("img",{style:m,src:h.buildMediaURL(e.url),alt:i.toString()}),e.caption&&(0,s.jsx)(d,{"data-testid":"stImageCaption",style:m,children:" ".concat(e.caption," ")})]},i)}))})}))}}]);
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[1729],{51729:(e,t,o)=>{o.r(t),o.d(t,{default:()=>N});var r=o(5057),i=o(47206),n=o(50120),a=o(80099),l=o(53381);function s(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function c(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?s(Object(o),!0).forEach((function(t){d(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function d(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function u(e){var t=e.$disabled,o=e.$checked,r=e.$isIndeterminate,i=e.$error,n=e.$isHovered,a=e.$isActive,l=e.$theme.colors;return t?o||r?l.tickFillDisabled:l.tickFill:i&&(r||o)?a?l.tickFillErrorSelectedHoverActive:n?l.tickFillErrorSelectedHover:l.tickFillErrorSelected:i?a?l.tickFillErrorHoverActive:n?l.tickFillErrorHover:l.tickFillError:r||o?a?l.tickFillSelectedHoverActive:n?l.tickFillSelectedHover:l.tickFillSelected:a?l.tickFillActive:n?l.tickFillHover:l.tickFill}function p(e){var t=e.$disabled,o=e.$theme.colors;return t?o.contentSecondary:o.contentPrimary}var h=(0,l.zo)("label",(function(e){var t=e.$disabled,o=e.$labelPlacement;return{flexDirection:"top"===o||"bottom"===o?"column":"row",display:"flex",alignItems:"top"===o||"bottom"===o?"center":"flex-start",cursor:t?"not-allowed":"pointer",userSelect:"none"}}));h.displayName="Root",h.displayName="Root";var m=(0,l.zo)("span",(function(e){var t=e.$checked,o=e.$disabled,r=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.sizing,s=n.animation,c=o?n.colors.tickMarkFillDisabled:r?n.colors.tickMarkFillError:n.colors.tickMarkFill,d=encodeURIComponent('\n <svg width="14" height="4" viewBox="0 0 14 4" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M14 0.5H0V3.5H14V0.5Z" fill="'.concat(c,'"/>\n </svg>\n ')),p=encodeURIComponent('\n <svg width="17" height="13" viewBox="0 0 17 13" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6.50002 12.6L0.400024 6.60002L2.60002 4.40002L6.50002 8.40002L13.9 0.900024L16.1 3.10002L6.50002 12.6Z" fill="'.concat(c,'"/>\n </svg>\n ')),h=n.borders.checkboxBorderRadius,m=function(e){var t=e.$disabled,o=e.$checked,r=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.colors;return t?l.tickFillDisabled:o||i?"transparent":r?l.borderNegative:a?l.borderSelected:l.tickBorder}(e);return{flex:"0 0 auto",transitionDuration:s.timing200,transitionTimingFunction:s.easeOutCurve,transitionProperty:"background-image, border-color, background-color",width:l.scale700,height:l.scale700,left:"4px",top:"4px",boxSizing:"border-box",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftWidth:"3px",borderRightWidth:"3px",borderTopWidth:"3px",borderBottomWidth:"3px",borderLeftColor:m,borderRightColor:m,borderTopColor:m,borderBottomColor:m,borderTopLeftRadius:h,borderTopRightRadius:h,borderBottomRightRadius:h,borderBottomLeftRadius:h,outline:a&&t?"3px solid ".concat(n.colors.accent):"none",display:"inline-block",verticalAlign:"middle",backgroundImage:i?"url('data:image/svg+xml,".concat(d,"');"):t?"url('data:image/svg+xml,".concat(p,"');"):null,backgroundColor:u(e),backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain",marginTop:n.sizing.scale0,marginBottom:n.sizing.scale0,marginLeft:n.sizing.scale0,marginRight:n.sizing.scale0}}));m.displayName="Checkmark",m.displayName="Checkmark";var g=(0,l.zo)("div",(function(e){var t=e.$theme.typography;return c(c(c({verticalAlign:"middle"},function(e){var t,o=e.$labelPlacement,r=void 0===o?"":o,i=e.$theme,n=i.sizing.scale300;switch(r){case"top":t="Bottom";break;case"bottom":t="Top";break;case"left":t="Right";break;default:t="Left"}return"rtl"===i.direction&&"Left"===t?t="Right":"rtl"===i.direction&&"Right"===t&&(t="Left"),d({},"padding".concat(t),n)}(e)),{},{color:p(e)},t.LabelMedium),{},{lineHeight:"24px"})}));g.displayName="Label",g.displayName="Label";var b=(0,l.zo)("input",{opacity:0,width:0,height:0,overflow:"hidden",margin:0,padding:0,position:"absolute"});b.displayName="Input",b.displayName="Input";var f=(0,l.zo)("div",(function(e){var t=e.$theme.colors.toggleFill;return e.$disabled?t=e.$theme.colors.toggleFillDisabled:e.$checked&&e.$error?t=e.$theme.colors.tickFillErrorSelected:e.$checked&&(t=e.$theme.colors.toggleFillChecked),{backgroundColor:t,borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(e.$theme.colors.accent):e.$isHovered&&!e.$disabled?e.$theme.lighting.shadow500:e.$theme.lighting.shadow400,outline:"none",height:e.$theme.sizing.scale700,width:e.$theme.sizing.scale700,transform:e.$checked?"translateX(".concat("rtl"===e.$theme.direction?"-100%":"100%",")"):null,transition:"transform ".concat(e.$theme.animation.timing200)}}));f.displayName="Toggle",f.displayName="Toggle";var v=(0,l.zo)("div",(function(e){var t=e.$theme.colors.toggleTrackFill;return e.$disabled?t=e.$theme.colors.toggleTrackFillDisabled:e.$error&&e.$checked&&(t=e.$theme.colors.tickFillError),{alignItems:"center",backgroundColor:t,borderTopLeftRadius:"7px",borderTopRightRadius:"7px",borderBottomRightRadius:"7px",borderBottomLeftRadius:"7px",display:"flex",height:e.$theme.sizing.scale550,marginTop:e.$theme.sizing.scale200,marginBottom:e.$theme.sizing.scale100,marginLeft:e.$theme.sizing.scale200,marginRight:e.$theme.sizing.scale100,width:e.$theme.sizing.scale1000}}));v.displayName="ToggleTrack",v.displayName="ToggleTrack";var y=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),k=Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"}),$=o(94253);function w(e){return w="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},w(e)}function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},x.apply(this,arguments)}function F(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function R(e,t){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},R(e,t)}function C(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,r=L(e);if(t){var i=L(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return function(e,t){if(t&&("object"===w(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return T(e)}(this,o)}}function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},L(e)}function O(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var S=function(e){return e.stopPropagation()},P=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}(l,e);var t,o,i,n=C(l);function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return O(T(e=n.call.apply(n,[this].concat(o))),"state",{isFocused:e.props.autoFocus||!1,isFocusVisible:!1,isHovered:!1,isActive:!1}),O(T(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter(t)})),O(T(e),"onMouseLeave",(function(t){e.setState({isHovered:!1,isActive:!1}),e.props.onMouseLeave(t)})),O(T(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown(t)})),O(T(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp(t)})),O(T(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t),(0,$.E)(t)&&e.setState({isFocusVisible:!0})})),O(T(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t),!1!==e.state.isFocusVisible&&e.setState({isFocusVisible:!1})})),e}return t=l,(o=[{key:"componentDidMount",value:function(){var e=this.props,t=e.autoFocus,o=e.inputRef;t&&o.current&&o.current.focus()}},{key:"render",value:function(){var e=this.props,t=e.overrides,o=void 0===t?{}:t,i=e.onChange,n=e.labelPlacement,l=void 0===n?this.props.checkmarkType===y.toggle?"left":"right":n,s=e.inputRef,c=e.isIndeterminate,d=e.error,u=e.disabled,p=e.value,k=e.name,$=e.type,w=e.checked,F=e.children,R=e.required,C=e.title,T=o.Root,L=o.Checkmark,O=o.Label,P=o.Input,M=o.Toggle,j=o.ToggleTrack,B=(0,a.XG)(T)||h,E=(0,a.XG)(L)||m,H=(0,a.XG)(O)||g,V=(0,a.XG)(P)||b,I=(0,a.XG)(M)||f,z=(0,a.XG)(j)||v,D={onChange:i,onFocus:this.onFocus,onBlur:this.onBlur},W={onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},A={$isFocused:this.state.isFocused,$isFocusVisible:this.state.isFocusVisible,$isHovered:this.state.isHovered,$isActive:this.state.isActive,$error:d,$checked:w,$isIndeterminate:c,$required:R,$disabled:u,$value:p},U=F&&r.createElement(H,x({$labelPlacement:l},A,(0,a.ch)(O)),this.props.containsInteractiveElement?r.createElement("div",{onClick:function(e){return e.preventDefault()}},F):F);return r.createElement(B,x({"data-baseweb":"checkbox",title:C||null,$labelPlacement:l},A,W,(0,a.ch)(T)),("top"===l||"left"===l)&&U,this.props.checkmarkType===y.toggle?r.createElement(z,x({},A,(0,a.ch)(j)),r.createElement(I,x({},A,(0,a.ch)(M)))):r.createElement(E,x({},A,(0,a.ch)(L))),r.createElement(V,x({value:p,name:k,checked:w,required:R,"aria-label":this.props["aria-label"]||this.props.ariaLabel,"aria-checked":c?"mixed":w,"aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":d||null,"aria-required":R||null,disabled:u,type:$,ref:s,onClick:S},A,D,(0,a.ch)(P))),("bottom"===l||"right"===l)&&U)}}])&&F(t.prototype,o),i&&F(t,i),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.Component);O(P,"defaultProps",{overrides:{},checked:!1,containsInteractiveElement:!1,disabled:!1,autoFocus:!1,isIndeterminate:!1,inputRef:r.createRef(),error:!1,type:"checkbox",checkmarkType:y.default,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});const M=P;var j=o(60913),B=o(59990),E=o(52955),H=o(17966),V=o(21034),I=o(98790),z=o(93905),D=o(46403);const W=(0,o(82160).Z)("div",{target:"edwcd610"})((e=>{let{visibility:t}=e;return{display:t===n.Ws.Collapsed?"none":"flex",visibility:t===n.Ws.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}}),"");var A=o(96266);class U extends r.PureComponent{constructor(){super(...arguments),this.formClearHelper=new E.K,this.state={value:this.initialValue},this.commitWidgetValue=e=>{this.props.widgetMgr.setBoolValue(this.props.element,this.state.value,e)},this.onFormCleared=()=>{this.setState(((e,t)=>({value:t.element.default})),(()=>this.commitWidgetValue({fromUi:!0})))},this.onChange=e=>{const t=e.target.checked;this.setState({value:t},(()=>this.commitWidgetValue({fromUi:!0})))}}get initialValue(){const e=this.props.widgetMgr.getBoolValue(this.props.element);return void 0!==e?e:this.props.element.default}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:e},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var e;const{theme:t,width:o,element:r,disabled:i,widgetMgr:a}=this.props,{colors:l,spacing:s}=t,c=(0,H.Iy)(t),d={width:o},u=i?l.fadedText40:l.bodyText;return this.formClearHelper.manageFormClearListener(a,r.formId,this.onFormCleared),(0,A.jsx)("div",{className:"row-widget stCheckbox","data-testid":"stCheckbox",style:d,children:(0,A.jsx)(M,{checked:this.state.value,disabled:i,onChange:this.onChange,"aria-label":r.label,checkmarkType:r.type===j.XZ.StyleType.TOGGLE?y.toggle:y.default,labelPlacement:k.right,overrides:{Root:{style:e=>{let{$isFocusVisible:t}=e;return{marginBottom:0,marginTop:0,paddingRight:s.twoThirdsSmFont,backgroundColor:t?l.darkenedBgMix25:"",display:"flex",alignItems:"start"}}},Toggle:{style:e=>{let{$checked:t}=e,o=c?l.bgColor:l.bodyText;return i&&(o=c?l.gray60:l.gray90),{width:"12px",height:"12px",transform:t?"translateX(16px)":"",backgroundColor:o,boxShadow:""}}},ToggleTrack:{style:e=>{let{$checked:o,$isHovered:r}=e,n=c?l.gray50:l.gray80;return r&&!i&&(n=c?l.gray60:l.gray70),o&&!i&&(n=l.primary),{marginRight:0,marginLeft:"2px",paddingLeft:"2px",paddingRight:"2px",width:"32px",minWidth:"32px",height:"16px",minHeight:"16px",borderBottomLeftRadius:t.radii.lg,borderTopLeftRadius:t.radii.lg,borderBottomRightRadius:t.radii.lg,borderTopRightRadius:t.radii.lg,backgroundColor:n}}},Checkmark:{style:e=>{let{$isFocusVisible:t,$checked:o}=e;const r=o&&!i?l.primary:l.fadedText40;return{outline:0,width:"1rem",height:"1rem",marginTop:"0.30rem",boxShadow:t&&o?"0 0 0 0.2rem ".concat((0,B.DZ)(l.primary,.5)):"",borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px",borderLeftColor:r,borderRightColor:r,borderTopColor:r,borderBottomColor:r}}},Label:{style:{position:"relative",top:"1px",color:u}}},children:(0,A.jsxs)(W,{visibility:(0,n.iF)(null===(e=r.labelVisibility)||void 0===e?void 0:e.value),"data-testid":"stWidgetLabel",children:[(0,A.jsx)(D.ZP,{source:r.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),r.help&&(0,A.jsx)(z.Hp,{color:u,children:(0,A.jsx)(V.Z,{content:r.help,placement:I.u.TOP_RIGHT})})]})})})}}const N=(0,i.b)(U)},52955:(e,t,o)=>{o.d(t,{K:()=>i});var r=o(50120);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,o){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,r.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,o),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
1
+ "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[1729],{51729:(e,t,o)=>{o.r(t),o.d(t,{default:()=>N});var r=o(5057),i=o(47206),n=o(50120),a=o(80099),l=o(53381);function s(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function c(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?s(Object(o),!0).forEach((function(t){d(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function d(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function u(e){var t=e.$disabled,o=e.$checked,r=e.$isIndeterminate,i=e.$error,n=e.$isHovered,a=e.$isActive,l=e.$theme.colors;return t?o||r?l.tickFillDisabled:l.tickFill:i&&(r||o)?a?l.tickFillErrorSelectedHoverActive:n?l.tickFillErrorSelectedHover:l.tickFillErrorSelected:i?a?l.tickFillErrorHoverActive:n?l.tickFillErrorHover:l.tickFillError:r||o?a?l.tickFillSelectedHoverActive:n?l.tickFillSelectedHover:l.tickFillSelected:a?l.tickFillActive:n?l.tickFillHover:l.tickFill}function p(e){var t=e.$disabled,o=e.$theme.colors;return t?o.contentSecondary:o.contentPrimary}var h=(0,l.zo)("label",(function(e){var t=e.$disabled,o=e.$labelPlacement;return{flexDirection:"top"===o||"bottom"===o?"column":"row",display:"flex",alignItems:"top"===o||"bottom"===o?"center":"flex-start",cursor:t?"not-allowed":"pointer",userSelect:"none"}}));h.displayName="Root",h.displayName="Root";var m=(0,l.zo)("span",(function(e){var t=e.$checked,o=e.$disabled,r=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.sizing,s=n.animation,c=o?n.colors.tickMarkFillDisabled:r?n.colors.tickMarkFillError:n.colors.tickMarkFill,d=encodeURIComponent('\n <svg width="14" height="4" viewBox="0 0 14 4" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M14 0.5H0V3.5H14V0.5Z" fill="'.concat(c,'"/>\n </svg>\n ')),p=encodeURIComponent('\n <svg width="17" height="13" viewBox="0 0 17 13" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6.50002 12.6L0.400024 6.60002L2.60002 4.40002L6.50002 8.40002L13.9 0.900024L16.1 3.10002L6.50002 12.6Z" fill="'.concat(c,'"/>\n </svg>\n ')),h=n.borders.checkboxBorderRadius,m=function(e){var t=e.$disabled,o=e.$checked,r=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.colors;return t?l.tickFillDisabled:o||i?"transparent":r?l.borderNegative:a?l.borderSelected:l.tickBorder}(e);return{flex:"0 0 auto",transitionDuration:s.timing200,transitionTimingFunction:s.easeOutCurve,transitionProperty:"background-image, border-color, background-color",width:l.scale700,height:l.scale700,left:"4px",top:"4px",boxSizing:"border-box",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftWidth:"3px",borderRightWidth:"3px",borderTopWidth:"3px",borderBottomWidth:"3px",borderLeftColor:m,borderRightColor:m,borderTopColor:m,borderBottomColor:m,borderTopLeftRadius:h,borderTopRightRadius:h,borderBottomRightRadius:h,borderBottomLeftRadius:h,outline:a&&t?"3px solid ".concat(n.colors.accent):"none",display:"inline-block",verticalAlign:"middle",backgroundImage:i?"url('data:image/svg+xml,".concat(d,"');"):t?"url('data:image/svg+xml,".concat(p,"');"):null,backgroundColor:u(e),backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain",marginTop:n.sizing.scale0,marginBottom:n.sizing.scale0,marginLeft:n.sizing.scale0,marginRight:n.sizing.scale0}}));m.displayName="Checkmark",m.displayName="Checkmark";var g=(0,l.zo)("div",(function(e){var t=e.$theme.typography;return c(c(c({verticalAlign:"middle"},function(e){var t,o=e.$labelPlacement,r=void 0===o?"":o,i=e.$theme,n=i.sizing.scale300;switch(r){case"top":t="Bottom";break;case"bottom":t="Top";break;case"left":t="Right";break;default:t="Left"}return"rtl"===i.direction&&"Left"===t?t="Right":"rtl"===i.direction&&"Right"===t&&(t="Left"),d({},"padding".concat(t),n)}(e)),{},{color:p(e)},t.LabelMedium),{},{lineHeight:"24px"})}));g.displayName="Label",g.displayName="Label";var b=(0,l.zo)("input",{opacity:0,width:0,height:0,overflow:"hidden",margin:0,padding:0,position:"absolute"});b.displayName="Input",b.displayName="Input";var f=(0,l.zo)("div",(function(e){var t=e.$theme.colors.toggleFill;return e.$disabled?t=e.$theme.colors.toggleFillDisabled:e.$checked&&e.$error?t=e.$theme.colors.tickFillErrorSelected:e.$checked&&(t=e.$theme.colors.toggleFillChecked),{backgroundColor:t,borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(e.$theme.colors.accent):e.$isHovered&&!e.$disabled?e.$theme.lighting.shadow500:e.$theme.lighting.shadow400,outline:"none",height:e.$theme.sizing.scale700,width:e.$theme.sizing.scale700,transform:e.$checked?"translateX(".concat("rtl"===e.$theme.direction?"-100%":"100%",")"):null,transition:"transform ".concat(e.$theme.animation.timing200)}}));f.displayName="Toggle",f.displayName="Toggle";var v=(0,l.zo)("div",(function(e){var t=e.$theme.colors.toggleTrackFill;return e.$disabled?t=e.$theme.colors.toggleTrackFillDisabled:e.$error&&e.$checked&&(t=e.$theme.colors.tickFillError),{alignItems:"center",backgroundColor:t,borderTopLeftRadius:"7px",borderTopRightRadius:"7px",borderBottomRightRadius:"7px",borderBottomLeftRadius:"7px",display:"flex",height:e.$theme.sizing.scale550,marginTop:e.$theme.sizing.scale200,marginBottom:e.$theme.sizing.scale100,marginLeft:e.$theme.sizing.scale200,marginRight:e.$theme.sizing.scale100,width:e.$theme.sizing.scale1000}}));v.displayName="ToggleTrack",v.displayName="ToggleTrack";var y=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),k=Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"}),$=o(94253);function w(e){return w="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},w(e)}function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},x.apply(this,arguments)}function F(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function R(e,t){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},R(e,t)}function T(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,r=L(e);if(t){var i=L(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return function(e,t){if(t&&("object"===w(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return C(e)}(this,o)}}function C(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},L(e)}function O(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var S=function(e){return e.stopPropagation()},P=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}(l,e);var t,o,i,n=T(l);function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return O(C(e=n.call.apply(n,[this].concat(o))),"state",{isFocused:e.props.autoFocus||!1,isFocusVisible:!1,isHovered:!1,isActive:!1}),O(C(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter(t)})),O(C(e),"onMouseLeave",(function(t){e.setState({isHovered:!1,isActive:!1}),e.props.onMouseLeave(t)})),O(C(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown(t)})),O(C(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp(t)})),O(C(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t),(0,$.E)(t)&&e.setState({isFocusVisible:!0})})),O(C(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t),!1!==e.state.isFocusVisible&&e.setState({isFocusVisible:!1})})),e}return t=l,(o=[{key:"componentDidMount",value:function(){var e=this.props,t=e.autoFocus,o=e.inputRef;t&&o.current&&o.current.focus()}},{key:"render",value:function(){var e=this.props,t=e.overrides,o=void 0===t?{}:t,i=e.onChange,n=e.labelPlacement,l=void 0===n?this.props.checkmarkType===y.toggle?"left":"right":n,s=e.inputRef,c=e.isIndeterminate,d=e.error,u=e.disabled,p=e.value,k=e.name,$=e.type,w=e.checked,F=e.children,R=e.required,T=e.title,C=o.Root,L=o.Checkmark,O=o.Label,P=o.Input,M=o.Toggle,j=o.ToggleTrack,B=(0,a.XG)(C)||h,E=(0,a.XG)(L)||m,H=(0,a.XG)(O)||g,V=(0,a.XG)(P)||b,I=(0,a.XG)(M)||f,z=(0,a.XG)(j)||v,D={onChange:i,onFocus:this.onFocus,onBlur:this.onBlur},W={onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},A={$isFocused:this.state.isFocused,$isFocusVisible:this.state.isFocusVisible,$isHovered:this.state.isHovered,$isActive:this.state.isActive,$error:d,$checked:w,$isIndeterminate:c,$required:R,$disabled:u,$value:p},U=F&&r.createElement(H,x({$labelPlacement:l},A,(0,a.ch)(O)),this.props.containsInteractiveElement?r.createElement("div",{onClick:function(e){return e.preventDefault()}},F):F);return r.createElement(B,x({"data-baseweb":"checkbox",title:T||null,$labelPlacement:l},A,W,(0,a.ch)(C)),("top"===l||"left"===l)&&U,this.props.checkmarkType===y.toggle?r.createElement(z,x({},A,(0,a.ch)(j)),r.createElement(I,x({},A,(0,a.ch)(M)))):r.createElement(E,x({},A,(0,a.ch)(L))),r.createElement(V,x({value:p,name:k,checked:w,required:R,"aria-label":this.props["aria-label"]||this.props.ariaLabel,"aria-checked":c?"mixed":w,"aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":d||null,"aria-required":R||null,disabled:u,type:$,ref:s,onClick:S},A,D,(0,a.ch)(P))),("bottom"===l||"right"===l)&&U)}}])&&F(t.prototype,o),i&&F(t,i),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.Component);O(P,"defaultProps",{overrides:{},checked:!1,containsInteractiveElement:!1,disabled:!1,autoFocus:!1,isIndeterminate:!1,inputRef:r.createRef(),error:!1,type:"checkbox",checkmarkType:y.default,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});const M=P;var j=o(60913),B=o(59990),E=o(52955),H=o(96601),V=o(21034),I=o(98790),z=o(93905),D=o(46403);const W=(0,o(82160).Z)("div",{target:"edwcd610"})((e=>{let{visibility:t}=e;return{display:t===n.Ws.Collapsed?"none":"flex",visibility:t===n.Ws.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}}),"");var A=o(96266);class U extends r.PureComponent{constructor(){super(...arguments),this.formClearHelper=new E.K,this.state={value:this.initialValue},this.commitWidgetValue=e=>{this.props.widgetMgr.setBoolValue(this.props.element,this.state.value,e)},this.onFormCleared=()=>{this.setState(((e,t)=>({value:t.element.default})),(()=>this.commitWidgetValue({fromUi:!0})))},this.onChange=e=>{const t=e.target.checked;this.setState({value:t},(()=>this.commitWidgetValue({fromUi:!0})))}}get initialValue(){const e=this.props.widgetMgr.getBoolValue(this.props.element);return void 0!==e?e:this.props.element.default}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:e},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var e;const{theme:t,width:o,element:r,disabled:i,widgetMgr:a}=this.props,{colors:l,spacing:s}=t,c=(0,H.Iy)(t),d={width:o},u=i?l.fadedText40:l.bodyText;return this.formClearHelper.manageFormClearListener(a,r.formId,this.onFormCleared),(0,A.jsx)("div",{className:"row-widget stCheckbox","data-testid":"stCheckbox",style:d,children:(0,A.jsx)(M,{checked:this.state.value,disabled:i,onChange:this.onChange,"aria-label":r.label,checkmarkType:r.type===j.XZ.StyleType.TOGGLE?y.toggle:y.default,labelPlacement:k.right,overrides:{Root:{style:e=>{let{$isFocusVisible:t}=e;return{marginBottom:0,marginTop:0,paddingRight:s.twoThirdsSmFont,backgroundColor:t?l.darkenedBgMix25:"",display:"flex",alignItems:"start"}}},Toggle:{style:e=>{let{$checked:t}=e,o=c?l.bgColor:l.bodyText;return i&&(o=c?l.gray60:l.gray90),{width:"12px",height:"12px",transform:t?"translateX(16px)":"",backgroundColor:o,boxShadow:""}}},ToggleTrack:{style:e=>{let{$checked:o,$isHovered:r}=e,n=l.fadedText40;return r&&!i&&(n=l.fadedText20),o&&!i&&(n=l.primary),{marginRight:0,marginLeft:"2px",paddingLeft:"2px",paddingRight:"2px",width:"32px",minWidth:"32px",height:"16px",minHeight:"16px",borderBottomLeftRadius:t.radii.lg,borderTopLeftRadius:t.radii.lg,borderBottomRightRadius:t.radii.lg,borderTopRightRadius:t.radii.lg,backgroundColor:n}}},Checkmark:{style:e=>{let{$isFocusVisible:t,$checked:o}=e;const r=o&&!i?l.primary:l.fadedText40;return{outline:0,width:"1rem",height:"1rem",marginTop:"0.30rem",boxShadow:t&&o?"0 0 0 0.2rem ".concat((0,B.DZ)(l.primary,.5)):"",borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px",borderLeftColor:r,borderRightColor:r,borderTopColor:r,borderBottomColor:r}}},Label:{style:{position:"relative",top:"1px",color:u}}},children:(0,A.jsxs)(W,{visibility:(0,n.iF)(null===(e=r.labelVisibility)||void 0===e?void 0:e.value),"data-testid":"stWidgetLabel",children:[(0,A.jsx)(D.ZP,{source:r.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),r.help&&(0,A.jsx)(z.Hp,{color:u,children:(0,A.jsx)(V.Z,{content:r.help,placement:I.u.TOP_RIGHT})})]})})})}}const N=(0,i.b)(U)},52955:(e,t,o)=>{o.d(t,{K:()=>i});var r=o(50120);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,o){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,r.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,o),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[1740],{31740:(t,e,i)=>{i.r(e),i.d(e,{default:()=>o});i(5057);var l=i(44088),s=i(92649),d=i(38830),r=i(46403),a=i(19954),n=i(96266);const o=function(t){const{disabled:e,element:i,widgetMgr:o,width:u,endpoints:c}=t,h={width:u},b="primary"===i.type?l.nW.PRIMARY:l.nW.SECONDARY,p=(0,a.v_)(),w=!i.help||u;return(0,n.jsx)("div",{className:"row-widget stDownloadButton","data-testid":"stDownloadButton",style:h,children:(0,n.jsx)(s.t,{help:i.help,children:(0,n.jsx)(d.ZP,{kind:b,size:l.V5.SMALL,disabled:e,onClick:()=>{if(o.setTriggerValue(i,{fromUi:!0}),i.url.startsWith("/media"))return void(0,a.uP)(p,i.url);const t=document.createElement("a"),e=c.buildMediaURL(i.url);t.setAttribute("href",e),t.setAttribute("target","_self"),t.setAttribute("download",""),t.click()},fluidWidth:!!i.useContainerWidth&&w,children:(0,n.jsx)(r.ZP,{source:i.label,allowHTML:!1,isLabel:!0,largerLabel:!0,disableLinks:!0})})})})}}}]);
1
+ "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[1740],{31740:(t,e,i)=>{i.r(e),i.d(e,{default:()=>o});i(5057);var l=i(44088),s=i(92649),d=i(38830),r=i(46403),a=i(70442),n=i(96266);const o=function(t){const{disabled:e,element:i,widgetMgr:o,width:u,endpoints:c}=t,h={width:u},b="primary"===i.type?l.nW.PRIMARY:l.nW.SECONDARY,p=(0,a.v_)(),w=!i.help||u;return(0,n.jsx)("div",{className:"row-widget stDownloadButton","data-testid":"stDownloadButton",style:h,children:(0,n.jsx)(s.t,{help:i.help,children:(0,n.jsx)(d.ZP,{kind:b,size:l.V5.SMALL,disabled:e,onClick:()=>{if(o.setTriggerValue(i,{fromUi:!0}),i.url.startsWith("/media"))return void(0,a.uP)(p,i.url);const t=document.createElement("a"),e=c.buildMediaURL(i.url);t.setAttribute("href",e),t.setAttribute("target","_self"),t.setAttribute("download",""),t.click()},fluidWidth:!!i.useContainerWidth&&w,children:(0,n.jsx)(r.ZP,{source:i.label,allowHTML:!1,isLabel:!0,largerLabel:!0,disableLinks:!0})})})})}}}]);