streamlit-nightly 1.45.1.dev20250508__py3-none-any.whl → 1.45.1.dev20250510__py3-none-any.whl
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.
- streamlit/auth_util.py +3 -3
- streamlit/cli_util.py +3 -2
- streamlit/commands/execution_control.py +1 -1
- streamlit/commands/logo.py +2 -2
- streamlit/commands/navigation.py +6 -5
- streamlit/commands/page_config.py +3 -1
- streamlit/components/types/base_custom_component.py +7 -7
- streamlit/components/v1/custom_component.py +6 -6
- streamlit/config.py +9 -9
- streamlit/config_option.py +2 -2
- streamlit/connections/base_connection.py +3 -3
- streamlit/connections/snowflake_connection.py +5 -5
- streamlit/connections/snowpark_connection.py +3 -3
- streamlit/connections/sql_connection.py +9 -10
- streamlit/cursor.py +6 -6
- streamlit/delta_generator.py +7 -6
- streamlit/delta_generator_singletons.py +3 -3
- streamlit/deprecation_util.py +1 -1
- streamlit/elements/arrow.py +4 -5
- streamlit/elements/code.py +1 -1
- streamlit/elements/dialog_decorator.py +3 -3
- streamlit/elements/doc_string.py +20 -20
- streamlit/elements/layouts.py +26 -7
- streamlit/elements/lib/built_in_chart_utils.py +38 -40
- streamlit/elements/lib/color_util.py +3 -3
- streamlit/elements/lib/column_types.py +4 -4
- streamlit/elements/lib/dialog.py +2 -2
- streamlit/elements/lib/event_utils.py +1 -1
- streamlit/elements/lib/image_utils.py +1 -1
- streamlit/elements/lib/mutable_status_container.py +1 -1
- streamlit/elements/lib/options_selector_utils.py +2 -2
- streamlit/elements/lib/policies.py +3 -3
- streamlit/elements/lib/utils.py +5 -5
- streamlit/elements/metric.py +1 -1
- streamlit/elements/progress.py +9 -12
- streamlit/elements/vega_charts.py +3 -3
- streamlit/elements/widgets/audio_input.py +1 -1
- streamlit/elements/widgets/button.py +1 -1
- streamlit/elements/widgets/button_group.py +4 -4
- streamlit/elements/widgets/camera_input.py +1 -1
- streamlit/elements/widgets/checkbox.py +2 -2
- streamlit/elements/widgets/color_picker.py +1 -1
- streamlit/elements/widgets/data_editor.py +3 -3
- streamlit/elements/widgets/file_uploader.py +1 -1
- streamlit/elements/widgets/multiselect.py +3 -3
- streamlit/elements/widgets/number_input.py +2 -2
- streamlit/elements/widgets/radio.py +1 -1
- streamlit/elements/widgets/select_slider.py +1 -1
- streamlit/elements/widgets/selectbox.py +2 -2
- streamlit/elements/widgets/slider.py +19 -17
- streamlit/elements/widgets/text_widgets.py +2 -2
- streamlit/elements/widgets/time_widgets.py +2 -2
- streamlit/elements/write.py +3 -6
- streamlit/errors.py +34 -21
- streamlit/external/langchain/streamlit_callback_handler.py +2 -2
- streamlit/file_util.py +8 -8
- streamlit/git_util.py +2 -2
- streamlit/hello/dataframe_demo.py +1 -1
- streamlit/hello/mapping_demo.py +1 -1
- streamlit/navigation/page.py +1 -1
- streamlit/proto/Block_pb2.py +38 -29
- streamlit/proto/Block_pb2.pyi +68 -4
- streamlit/proto/DataFrame_pb2.pyi +1 -1
- streamlit/proto/GapSize_pb2.py +29 -0
- streamlit/proto/GapSize_pb2.pyi +70 -0
- streamlit/proto/HeightConfig_pb2.py +27 -0
- streamlit/proto/HeightConfig_pb2.pyi +48 -0
- streamlit/proto/NamedDataSet_pb2.pyi +1 -1
- streamlit/proto/WidthConfig_pb2.py +2 -2
- streamlit/proto/WidthConfig_pb2.pyi +15 -1
- streamlit/runtime/app_session.py +2 -2
- streamlit/runtime/caching/cache_data_api.py +9 -5
- streamlit/runtime/caching/cache_errors.py +3 -3
- streamlit/runtime/caching/cache_resource_api.py +7 -7
- streamlit/runtime/caching/cache_utils.py +9 -9
- streamlit/runtime/caching/cached_message_replay.py +1 -1
- streamlit/runtime/caching/hashing.py +70 -74
- streamlit/runtime/caching/legacy_cache_api.py +1 -1
- streamlit/runtime/caching/storage/in_memory_cache_storage_wrapper.py +3 -1
- streamlit/runtime/caching/storage/local_disk_cache_storage.py +1 -1
- streamlit/runtime/connection_factory.py +15 -15
- streamlit/runtime/context.py +2 -2
- streamlit/runtime/credentials.py +3 -3
- streamlit/runtime/fragment.py +3 -4
- streamlit/runtime/media_file_manager.py +2 -2
- streamlit/runtime/memory_media_file_storage.py +1 -1
- streamlit/runtime/memory_uploaded_file_manager.py +1 -1
- streamlit/runtime/metrics_util.py +5 -6
- streamlit/runtime/pages_manager.py +3 -3
- streamlit/runtime/runtime.py +1 -1
- streamlit/runtime/runtime_util.py +2 -2
- streamlit/runtime/scriptrunner/exec_code.py +10 -3
- streamlit/runtime/scriptrunner/magic.py +13 -8
- streamlit/runtime/scriptrunner/script_runner.py +2 -2
- streamlit/runtime/scriptrunner_utils/exceptions.py +1 -1
- streamlit/runtime/scriptrunner_utils/script_run_context.py +6 -5
- streamlit/runtime/secrets.py +8 -11
- streamlit/runtime/state/query_params.py +2 -2
- streamlit/runtime/state/query_params_proxy.py +1 -1
- streamlit/runtime/state/safe_session_state.py +2 -2
- streamlit/runtime/state/session_state.py +17 -15
- streamlit/runtime/stats.py +1 -1
- streamlit/runtime/uploaded_file_manager.py +1 -1
- streamlit/source_util.py +3 -4
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{ErrorOutline.esm.C9UoaGEN.js → ErrorOutline.esm.BewaDzzJ.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.DoToR9q0.js → FileDownload.esm.D6ilL7v-.js} +1 -1
- streamlit/static/static/js/{FileHelper.Bt4VJ--Q.js → FileHelper.q7erXtkb.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.D5PbW8FI.js → FormClearHelper.Dd0v0IXt.js} +1 -1
- streamlit/static/static/js/{Hooks.DgkQ2Xp9.js → Hooks.CchmJZGs.js} +1 -1
- streamlit/static/static/js/{InputInstructions.DLnLhwHI.js → InputInstructions.DI9h4PJ7.js} +1 -1
- streamlit/static/static/js/{ProgressBar.BtSgh_K-.js → ProgressBar.DfcVR_JA.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.CjdyBvQX.js → RenderInPortalIfExists.BAkT-LV5.js} +1 -1
- streamlit/static/static/js/{Toolbar.CAYIzVZk.js → Toolbar.CNzefYiX.js} +1 -1
- streamlit/static/static/js/{base-input.CD4xW4_9.js → base-input.BmA1ZV9Y.js} +1 -1
- streamlit/static/static/js/{checkbox.Ba4jj5dR.js → checkbox.mT4TKcAG.js} +1 -1
- streamlit/static/static/js/{createSuper.BBGT9Ijd.js → createSuper.Duo43uhY.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.CYuk1Aj7.js → data-grid-overlay-editor.CY3l_gmP.js} +1 -1
- streamlit/static/static/js/{downloader.DM9KEOCw.js → downloader.CM5asV91.js} +1 -1
- streamlit/static/static/js/{es6.FqM62T4b.js → es6.uiOeU51e.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.s2B09mw2.js → iframeResizer.contentWindow.ClkMmI3q.js} +1 -1
- streamlit/static/static/js/{index.Cwtbhfaf.js → index.1tDlzcmX.js} +1 -1
- streamlit/static/static/js/index.3d64wPzr.js +1 -0
- streamlit/static/static/js/{index.DQi04JYE.js → index.B-oXGsp7.js} +1 -1
- streamlit/static/static/js/{index.0pkoyBcb.js → index.B2EfQ-qM.js} +1 -1
- streamlit/static/static/js/{index.DkGCnTMe.js → index.B5wTpdet.js} +1 -1
- streamlit/static/static/js/{index.DG8IxVeM.js → index.B6y8ns6u.js} +2 -2
- streamlit/static/static/js/{index.B9FiDQ3U.js → index.BArkjssT.js} +1 -1
- streamlit/static/static/js/{index.CpDFZQ4Y.js → index.BPK3aPVr.js} +1 -1
- streamlit/static/static/js/index.BWubePhz.js +1 -0
- streamlit/static/static/js/{index.T5LKPcND.js → index.BmBUBll0.js} +1 -1
- streamlit/static/static/js/{index.BMXmhMlZ.js → index.BnmoQ0mJ.js} +1 -1
- streamlit/static/static/js/{index.BsjuUMyW.js → index.C1_voZpt.js} +1 -1
- streamlit/static/static/js/index.C6tuB1Tp.js +2 -0
- streamlit/static/static/js/{index.BoMRR3tN.js → index.CB8SwV8L.js} +1 -1
- streamlit/static/static/js/{index.CEKMSkSh.js → index.CXmZFP__.js} +36 -36
- streamlit/static/static/js/{index.DTi8Lw0k.js → index.CYAmxIg2.js} +1 -1
- streamlit/static/static/js/{index.DMrO9G6A.js → index.D-zMZsin.js} +1 -1
- streamlit/static/static/js/{index.JTeVe9GQ.js → index.D56z-_rt.js} +1 -1
- streamlit/static/static/js/index.D6AKDy4z.js +1 -0
- streamlit/static/static/js/{index.BFqpCk2P.js → index.D9lEoddJ.js} +1 -1
- streamlit/static/static/js/index.DAEzs_UL.js +1 -0
- streamlit/static/static/js/{index.BDTYk2an.js → index.DLO5_tVd.js} +1 -1
- streamlit/static/static/js/{index.BY7-qCf5.js → index.DLyB6OQM.js} +1 -1
- streamlit/static/static/js/index.DNWXtL99.js +1 -0
- streamlit/static/static/js/index.DbgE46VI.js +1 -0
- streamlit/static/static/js/{index.b9kK7Vzl.js → index.DeLPvnoy.js} +1 -1
- streamlit/static/static/js/{index.CH9XN_-G.js → index.DeeFVG0Y.js} +2 -2
- streamlit/static/static/js/{index.BVA8TXNT.js → index.Dhu_cVNQ.js} +1 -1
- streamlit/static/static/js/{index.R0peMEpV.js → index.Dj8nqcpI.js} +1 -1
- streamlit/static/static/js/{index.D9FvPPrI.js → index.DpWg6flp.js} +1 -1
- streamlit/static/static/js/{index.CeiCniCg.js → index.IqYlA3jn.js} +1 -1
- streamlit/static/static/js/{index.DSDkXosb.js → index.JA6OF_5t.js} +2 -2
- streamlit/static/static/js/{index.C2qCX1Lh.js → index.PoIwzrI7.js} +151 -151
- streamlit/static/static/js/{index.CqaahZPf.js → index.SW3uv22k.js} +1 -1
- streamlit/static/static/js/{index.DWaB7Scf.js → index.WlA_Ju7i.js} +1 -1
- streamlit/static/static/js/{index.CP2PmB93.js → index.blwBIOHe.js} +1 -1
- streamlit/static/static/js/{index.CyE1OdOj.js → index.wiodyGjO.js} +1 -1
- streamlit/static/static/js/{input.DMOGBelK.js → input.B3uNJm6d.js} +1 -1
- streamlit/static/static/js/{memory.DmCktBGW.js → memory.BWtwV556.js} +1 -1
- streamlit/static/static/js/{mergeWith.DeWTsJ5h.js → mergeWith.BeTmYGS_.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.DDFelcUP.js → number-overlay-editor.MW9-6kFx.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.CYJtAqB-.js → possibleConstructorReturn.ZgHiGHSO.js} +1 -1
- streamlit/static/static/js/{sandbox.CfaU9Ih9.js → sandbox.BZyTt4zT.js} +1 -1
- streamlit/static/static/js/{textarea.7hWYKDw2.js → textarea.CgvEg9Xi.js} +1 -1
- streamlit/static/static/js/{timepicker.DZsgZ9oE.js → timepicker.CHPC9KOb.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.CqWB4Jry.js → toConsumableArray.6GvveewD.js} +1 -1
- streamlit/static/static/js/{uniqueId.DQ533D9O.js → uniqueId.BV5h1uCx.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.-99xbU_o.js → useBasicWidgetState.DzE2MsN8.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.B4G2Q7Bu.js → useOnInputChange.sGAnyCSU.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.BJQZ2aNc.js → withFullScreenWrapper.Bh08pTH8.js} +1 -1
- streamlit/string_util.py +6 -7
- streamlit/temporary_directory.py +12 -3
- streamlit/testing/v1/app_test.py +11 -6
- streamlit/testing/v1/element_tree.py +134 -158
- streamlit/testing/v1/local_script_runner.py +5 -5
- streamlit/testing/v1/util.py +11 -4
- streamlit/type_util.py +3 -4
- streamlit/user_info.py +3 -2
- streamlit/util.py +1 -1
- streamlit/vendor/pympler/asizeof.py +1 -1
- streamlit/watcher/event_based_path_watcher.py +1 -1
- streamlit/watcher/folder_black_list.py +1 -1
- streamlit/watcher/local_sources_watcher.py +5 -5
- streamlit/watcher/path_watcher.py +1 -1
- streamlit/web/cli.py +12 -11
- streamlit/web/server/browser_websocket_handler.py +1 -1
- streamlit/web/server/component_request_handler.py +1 -1
- streamlit/web/server/media_file_handler.py +2 -1
- streamlit/web/server/oauth_authlib_routes.py +2 -2
- streamlit/web/server/oidc_mixin.py +13 -6
- streamlit/web/server/routes.py +3 -3
- streamlit/web/server/server.py +1 -1
- streamlit/web/server/server_util.py +7 -6
- streamlit/web/server/upload_file_request_handler.py +5 -5
- {streamlit_nightly-1.45.1.dev20250508.dist-info → streamlit_nightly-1.45.1.dev20250510.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.45.1.dev20250508.dist-info → streamlit_nightly-1.45.1.dev20250510.dist-info}/RECORD +201 -197
- {streamlit_nightly-1.45.1.dev20250508.dist-info → streamlit_nightly-1.45.1.dev20250510.dist-info}/WHEEL +1 -1
- streamlit/static/static/js/index.CCD4LJ9Q.js +0 -1
- streamlit/static/static/js/index.CbLZDRQu.js +0 -1
- streamlit/static/static/js/index.D9qEk5xd.js +0 -1
- streamlit/static/static/js/index.DTXSsTgK.js +0 -1
- streamlit/static/static/js/index.DqVjOqxm.js +0 -1
- streamlit/static/static/js/index.RHbaxsqm.js +0 -1
- streamlit/static/static/js/index.hT9gkW3a.js +0 -2
- {streamlit_nightly-1.45.1.dev20250508.data → streamlit_nightly-1.45.1.dev20250510.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.45.1.dev20250508.dist-info → streamlit_nightly-1.45.1.dev20250510.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.45.1.dev20250508.dist-info → streamlit_nightly-1.45.1.dev20250510.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
|
|
1
|
-
import{r,b as z}from"./index.
|
1
|
+
import{r,b as z}from"./index.PoIwzrI7.js";import{s as J,i as w,a as Q,b as U,T as Z,C as ee,m as te}from"./index.CXmZFP__.js";import"./FormClearHelper.Dd0v0IXt.js";import"./withFullScreenWrapper.Bh08pTH8.js";import"./Toolbar.CNzefYiX.js";import"./checkbox.mT4TKcAG.js";import"./mergeWith.BeTmYGS_.js";import"./sprintf.D7DtBTRn.js";import"./createDownloadLinkElement.DZMwyjvU.js";import"./toConsumableArray.6GvveewD.js";import"./possibleConstructorReturn.ZgHiGHSO.js";import"./createSuper.Duo43uhY.js";import"./FileDownload.esm.D6ilL7v-.js";const re=()=>t=>t.targetX,ie=()=>t=>t.targetY,ne=()=>t=>t.targetWidth,se=()=>t=>t.targetHeight,ae=()=>t=>t.targetY+10,oe=()=>t=>Math.max(0,(t.targetHeight-28)/2),de=J("div")({name:"DataGridOverlayEditorStyle",class:"gdg-d19meir1",propsAsIs:!1,vars:{"d19meir1-0":[ie(),"px"],"d19meir1-1":[re(),"px"],"d19meir1-2":[ne(),"px"],"d19meir1-3":[se(),"px"],"d19meir1-4":[ae(),"px"],"d19meir1-5":[oe(),"px"]}});function le(){const[t,s]=r.useState();return[t??void 0,s]}function ue(){const[t,s]=le(),[n,y]=r.useState(0),[g,x]=r.useState(!0);r.useLayoutEffect(()=>{if(t===void 0||!("IntersectionObserver"in window))return;const a=new IntersectionObserver(o=>{o.length!==0&&x(o[0].isIntersecting)},{threshold:1});return a.observe(t),()=>a.disconnect()},[t]),r.useEffect(()=>{if(g||t===void 0)return;let a;const o=()=>{const{right:v}=t.getBoundingClientRect();y(p=>Math.min(p+window.innerWidth-v-10,0)),a=requestAnimationFrame(o)};return a=requestAnimationFrame(o),()=>{a!==void 0&&cancelAnimationFrame(a)}},[t,g]);const O=r.useMemo(()=>({transform:`translateX(${n}px)`}),[n]);return{ref:s,style:O}}const Se=t=>{const{target:s,content:n,onFinishEditing:y,forceEditMode:g,initialValue:x,imageEditorOverride:O,markdownDivCreateNode:a,highlight:o,className:v,theme:p,id:H,cell:S,bloom:c,validateCell:d,getCellRenderer:F,provideEditor:h,isOutsideClick:X,customEventTarget:A}=t,[l,K]=r.useState(g?n:void 0),k=r.useRef(l??n);k.current=l??n;const[E,R]=r.useState(()=>d===void 0?!0:!(w(n)&&(d==null?void 0:d(S,n,k.current))===!1)),f=r.useCallback((e,i)=>{y(E?e:void 0,i)},[E,y]),W=r.useCallback(e=>{if(d!==void 0&&e!==void 0&&w(e)){const i=d(S,e,k.current);i===!1?R(!1):(typeof i=="object"&&(e=i),R(!0))}K(e)},[S,d]),C=r.useRef(!1),m=r.useRef(void 0),Y=r.useCallback(()=>{f(l,[0,0]),C.current=!0},[l,f]),j=r.useCallback((e,i)=>{f(e,i??m.current??[0,0]),C.current=!0},[f]),q=r.useCallback(async e=>{let i=!1;e.key==="Escape"?(e.stopPropagation(),e.preventDefault(),m.current=[0,0]):e.key==="Enter"&&!e.shiftKey?(e.stopPropagation(),e.preventDefault(),m.current=[0,1],i=!0):e.key==="Tab"&&(e.stopPropagation(),e.preventDefault(),m.current=[e.shiftKey?-1:1,0],i=!0),window.setTimeout(()=>{!C.current&&m.current!==void 0&&(f(i?l:void 0,m.current),C.current=!0)},0)},[f,l]),D=l??n,[u,B]=r.useMemo(()=>{var i,G;if(Q(n))return[];const e=h==null?void 0:h(n);return e!==void 0?[e,!1]:[(G=(i=F(n))==null?void 0:i.provideEditor)==null?void 0:G.call(i,n),!1]},[n,F,h]),{ref:L,style:$}=ue();let P=!0,T,M=!0,b;if(u!==void 0){P=u.disablePadding!==!0,M=u.disableStyling!==!0;const e=U(u);e&&(b=u.styleOverride);const i=e?u.editor:u;T=r.createElement(i,{isHighlighted:o,onChange:W,value:D,initialValue:x,onFinishedEditing:j,validatedSelection:w(D)?D.selectionRange:void 0,forceEditMode:g,target:s,imageEditorOverride:O,markdownDivCreateNode:a,isValid:E,theme:p})}b={...b,...$};const _=document.getElementById("portal");if(_===null)return console.error('Cannot open Data Grid overlay editor, because portal not found. Please add `<div id="portal" />` as the last child of your `<body>`.'),null;let I=M?"gdg-style":"gdg-unstyle";E||(I+=" gdg-invalid"),P&&(I+=" gdg-pad");const N=(c==null?void 0:c[0])??1,V=(c==null?void 0:c[1])??1;return z.createPortal(r.createElement(Z.Provider,{value:p},r.createElement(ee,{style:te(p),className:v,onClickOutside:Y,isOutsideClick:X,customEventTarget:A},r.createElement(de,{ref:L,id:H,className:I,style:b,as:B===!0?"label":void 0,targetX:s.x-N,targetY:s.y-V,targetWidth:s.width+N*2,targetHeight:s.height+V*2},r.createElement("div",{className:"gdg-clip-region",onKeyDown:q},T)))),_)};export{Se as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{c as b,e as P}from"./es6.
|
1
|
+
import{c as b,e as P}from"./es6.uiOeU51e.js";import"./index.PoIwzrI7.js";const{WritableStream:y,TransformStream:_,DOMException:v,Blob:u}=b,{GONE:E}=P,M=/constructor/i.test(window.HTMLElement);class F{constructor(e="unkown"){this.name=e,this.kind="file"}async getFile(){throw new v(...E)}async isSameEntry(e){return this===e}async createWritable(e={}){var d;const t=await((d=navigator.serviceWorker)==null?void 0:d.getRegistration()),o=document.createElement("a"),n=new _,R=n.writable;if(o.download=this.name,M||!t){let r=[];n.readable.pipeTo(new y({write(s){r.push(new u([s]))},close(){const s=new u(r,{type:"application/octet-stream; charset=utf-8"});r=[],o.href=URL.createObjectURL(s),o.click(),setTimeout(()=>URL.revokeObjectURL(o.href),1e4)}}))}else{const{writable:r,readablePort:s}=new j(y),a=encodeURIComponent(this.name).replace(/['()]/g,escape).replace(/\*/g,"%2A"),f={"content-disposition":"attachment; filename*=UTF-8''"+a,"content-type":"application/octet-stream; charset=utf-8",...e.size?{"content-length":e.size}:{}},g=setTimeout(()=>t.active.postMessage(0),1e4);n.readable.pipeThrough(new _({transform(c,h){if(c instanceof Uint8Array)return h.enqueue(c);const w=new Response(c).body.getReader(),p=W=>w.read().then(m=>m.done?0:p(h.enqueue(m.value)));return p()}})).pipeTo(r).finally(()=>{clearInterval(g)}),t.active.postMessage({url:t.scope+a,headers:f,readablePort:s},[s]);const i=document.createElement("iframe");i.hidden=!0,i.src=t.scope+a,document.body.appendChild(i)}return R.getWriter()}}const T=0,L=0,O=1,U=1,k=2;class S{constructor(e){e.onmessage=t=>this._onMessage(t.data),this._port=e,this._resetReady()}start(e){return this._controller=e,this._readyPromise}write(e){const t={type:T,chunk:e};return this._port.postMessage(t,[e.buffer]),this._resetReady(),this._readyPromise}close(){this._port.postMessage({type:k}),this._port.close()}abort(e){this._port.postMessage({type:U,reason:e}),this._port.close()}_onMessage(e){e.type===L&&this._resolveReady(),e.type===O&&this._onError(e.reason)}_onError(e){this._controller.error(e),this._rejectReady(e),this._port.close()}_resetReady(){this._readyPromise=new Promise((e,t)=>{this._readyResolve=e,this._readyReject=t}),this._readyPending=!0}_resolveReady(){this._readyResolve(),this._readyPending=!1}_rejectReady(e){this._readyPending||this._resetReady(),this._readyPromise.catch(()=>{}),this._readyReject(e),this._readyPending=!1}}class j{constructor(e){const t=new MessageChannel;this.readablePort=t.port1,this.writable=new e(new S(t.port2))}}export{F as FileHandle};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./downloader.
|
2
|
-
var G=Object.defineProperty;var R=a=>{throw TypeError(a)};var Y=(a,t,e)=>t in a?G(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var g=(a,t,e)=>Y(a,typeof t!="symbol"?t+"":t,e),X=(a,t,e)=>t.has(a)||R("Cannot "+e);var j=(a,t,e)=>t.has(a)?R("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(a):t.set(a,e),M=(a,t,e,r)=>(X(a,t,"write to private field"),r?r.call(a,e):t.set(a,e),e);import{y as d}from"./index.C2qCX1Lh.js";const N=globalThis.showDirectoryPicker;async function k(a={}){if(N&&!a._preferPolyfill)return N(a);const t=document.createElement("input");t.type="file",t.webkitdirectory=!0,t.multiple=!0,t.style.position="fixed",t.style.top="-100000px",t.style.left="-100000px",document.body.appendChild(t);const e=d(()=>Promise.resolve().then(()=>B),void 0,import.meta.url);return await new Promise(r=>{t.addEventListener("change",r),t.click()}),e.then(r=>r.getDirHandlesFromInput(t))}const J={accepts:[]},V=globalThis.showOpenFilePicker;async function K(a={}){const t={...J,...a};if(V&&!a._preferPolyfill)return V(t);const e=document.createElement("input");e.type="file",e.multiple=t.multiple,e.accept=(t.accepts||[]).map(n=>[...(n.extensions||[]).map(o=>"."+o),...n.mimeTypes||[]]).flat().join(","),Object.assign(e.style,{position:"fixed",top:"-100000px",left:"-100000px"}),document.body.appendChild(e);const r=d(()=>Promise.resolve().then(()=>B),void 0,import.meta.url);return await new Promise(n=>{e.addEventListener("change",n,{once:!0}),e.click()}),e.remove(),r.then(n=>n.getFileHandlesFromInput(e))}const W=globalThis.showSaveFilePicker;async function Q(a={}){if(W&&!a._preferPolyfill)return W(a);a._name&&(console.warn("deprecated _name, spec now have `suggestedName`"),a.suggestedName=a._name);const{FileSystemFileHandle:t}=await d(async()=>{const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:r}},void 0,import.meta.url),{FileHandle:e}=await d(async()=>{const{FileHandle:r}=await import("./downloader.DM9KEOCw.js");return{FileHandle:r}},__vite__mapDeps([0,1,2]),import.meta.url);return new t(new e(a.suggestedName))}globalThis.DataTransferItem&&!DataTransferItem.prototype.getAsFileSystemHandle&&(DataTransferItem.prototype.getAsFileSystemHandle=async function(){const a=this.webkitGetAsEntry(),[{FileHandle:t,FolderHandle:e},{FileSystemDirectoryHandle:r},{FileSystemFileHandle:n}]=await Promise.all([d(()=>import("./sandbox.CfaU9Ih9.js"),__vite__mapDeps([3,1,2]),import.meta.url),d(()=>Promise.resolve().then(()=>D),void 0,import.meta.url),d(()=>Promise.resolve().then(()=>_),void 0,import.meta.url)]);return a.isFile?new n(new t(a,!1)):new r(new e(a,!1))});async function Z(a,t={}){var o,s;if(!a)return((s=(o=globalThis.navigator)==null?void 0:o.storage)==null?void 0:s.getDirectory())||globalThis.getOriginPrivateDirectory();const{FileSystemDirectoryHandle:e}=await d(async()=>{const{FileSystemDirectoryHandle:y}=await Promise.resolve().then(()=>D);return{FileSystemDirectoryHandle:y}},void 0,import.meta.url),r=await a,n=await(r.default?r.default(t):r(t));return new e(n)}const ee={WritableStream:globalThis.WritableStream,TransformStream:globalThis.TransformStream,DOMException:globalThis.DOMException,Blob:globalThis.Blob,File:globalThis.File},{WritableStream:te}=ee;var H;const L=class L extends te{constructor(e){super(e);j(this,H);M(this,H,e),Object.setPrototypeOf(this,L.prototype),this._closed=!1}async close(){this._closed=!0;const e=this.getWriter(),r=e.close();return e.releaseLock(),r}seek(e){return this.write({type:"seek",position:e})}truncate(e){return this.write({type:"truncate",size:e})}write(e){if(this._closed)return Promise.reject(new TypeError("Cannot write to a CLOSED writable stream"));const r=this.getWriter(),n=r.write(e);return r.releaseLock(),n}};H=new WeakMap;let p=L;Object.defineProperty(p.prototype,Symbol.toStringTag,{value:"FileSystemWritableFileStream",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(p.prototype,{close:{enumerable:!0},seek:{enumerable:!0},truncate:{enumerable:!0},write:{enumerable:!0}});globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable&&!globalThis.FileSystemWritableFileStream&&(globalThis.FileSystemWritableFileStream=p);const m=Symbol("adapter");var q;q=m;class P{constructor(t){g(this,q);g(this,"name");g(this,"kind");this.kind=t.kind,this.name=t.name,this[m]=t}async queryPermission(t={}){const{mode:e="read"}=t,r=this[m];if(r.queryPermission)return r.queryPermission({mode:e});if(e==="read")return"granted";if(e==="readwrite")return r.writable?"granted":"denied";throw new TypeError(`Mode ${e} must be 'read' or 'readwrite'`)}async requestPermission({mode:t="read"}={}){const e=this[m];if(e.requestPermission)return e.requestPermission({mode:t});if(t==="read")return"granted";if(t==="readwrite")return e.writable?"granted":"denied";throw new TypeError(`Mode ${t} must be 'read' or 'readwrite'`)}async remove(t={}){await this[m].remove(t)}async isSameEntry(t){return this===t?!0:!t||typeof t!="object"||this.kind!==t.kind||!t[m]?!1:this[m].isSameEntry(t[m])}}Object.defineProperty(P.prototype,Symbol.toStringTag,{value:"FileSystemHandle",writable:!1,enumerable:!1,configurable:!0});var $;globalThis.FileSystemHandle&&(($=globalThis.FileSystemHandle.prototype).queryPermission??($.queryPermission=function(a){return"granted"}));const x={INVALID:["seeking position failed.","InvalidStateError"],GONE:["A requested file or directory could not be found at the time an operation was processed.","NotFoundError"],MISMATCH:["The path supplied exists, but was not an entry of requested type.","TypeMismatchError"],MOD_ERR:["The object can not be modified in this way.","InvalidModificationError"],SYNTAX:a=>[`Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. ${a}`,"SyntaxError"],SECURITY:["It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources.","SecurityError"],DISALLOWED:["The request is not allowed by the user agent or the platform in the current context.","NotAllowedError"]},re={writable:globalThis.WritableStream};async function ae(a){console.warn("deprecated fromDataTransfer - use `dt.items[0].getAsFileSystemHandle()` instead");const[t,e,r]=await Promise.all([d(()=>import("./memory.DmCktBGW.js"),__vite__mapDeps([4,1,2]),import.meta.url),d(()=>import("./sandbox.CfaU9Ih9.js"),__vite__mapDeps([3,1,2]),import.meta.url),d(()=>Promise.resolve().then(()=>D),void 0,import.meta.url)]),n=new t.FolderHandle("",!1);return n._entries=a.map(o=>o.isFile?new e.FileHandle(o,!1):new e.FolderHandle(o,!1)),new r.FileSystemDirectoryHandle(n)}async function ie(a){const{FolderHandle:t,FileHandle:e}=await d(async()=>{const{FolderHandle:y,FileHandle:l}=await import("./memory.DmCktBGW.js");return{FolderHandle:y,FileHandle:l}},__vite__mapDeps([4,1,2]),import.meta.url),{FileSystemDirectoryHandle:r}=await d(async()=>{const{FileSystemDirectoryHandle:y}=await Promise.resolve().then(()=>D);return{FileSystemDirectoryHandle:y}},void 0,import.meta.url),n=Array.from(a.files),o=n[0].webkitRelativePath.split("/",1)[0],s=new t(o,!1);return n.forEach(y=>{const l=y.webkitRelativePath.split("/");l.shift();const c=l.pop(),f=l.reduce((w,b)=>(w._entries[b]||(w._entries[b]=new t(b,!1)),w._entries[b]),s);f._entries[c]=new e(y.name,y,!1)}),new r(s)}async function ne(a){const{FileHandle:t}=await d(async()=>{const{FileHandle:r}=await import("./memory.DmCktBGW.js");return{FileHandle:r}},__vite__mapDeps([4,1,2]),import.meta.url),{FileSystemFileHandle:e}=await d(async()=>{const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:r}},void 0,import.meta.url);return Array.from(a.files).map(r=>new e(new t(r.name,r,!1)))}const B=Object.freeze(Object.defineProperty({__proto__:null,config:re,errors:x,fromDataTransfer:ae,getDirHandlesFromInput:ie,getFileHandlesFromInput:ne},Symbol.toStringTag,{value:"Module"})),{GONE:oe,MOD_ERR:se}=x,u=Symbol("adapter");var z;let F=class T extends P{constructor(e){super(e);g(this,z);this[u]=e}async getDirectoryHandle(e,r={}){if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");r.create=!!r.create;const n=await this[u].getDirectoryHandle(e,r);return new T(n)}async*entries(){const{FileSystemFileHandle:e}=await d(async()=>{const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:r}},void 0,import.meta.url);for await(const[r,n]of this[u].entries())yield[n.name,n.kind==="file"?new e(n):new T(n)]}async*getEntries(){const{FileSystemFileHandle:e}=await d(async()=>{const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:r}},void 0,import.meta.url);console.warn("deprecated, use .entries() instead");for await(let r of this[u].entries())yield r.kind==="file"?new e(r):new T(r)}async getFileHandle(e,r={}){const{FileSystemFileHandle:n}=await d(async()=>{const{FileSystemFileHandle:s}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:s}},void 0,import.meta.url);if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");r.create=!!r.create;const o=await this[u].getFileHandle(e,r);return new n(o)}async removeEntry(e,r={}){if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");return r.recursive=!!r.recursive,this[u].removeEntry(e,r)}async resolve(e){if(await e.isSameEntry(this))return[];const r=[{handle:this,path:[]}];for(;r.length;){let{handle:n,path:o}=r.pop();for await(const s of n.values()){if(await s.isSameEntry(e))return[...o,s.name];s.kind==="directory"&&r.push({handle:s,path:[...o,s.name]})}}return null}async*keys(){for await(const[e]of this[u].entries())yield e}async*values(){for await(const[e,r]of this)yield r}[(z=u,Symbol.asyncIterator)](){return this.entries()}};Object.defineProperty(F.prototype,Symbol.toStringTag,{value:"FileSystemDirectoryHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(F.prototype,{getDirectoryHandle:{enumerable:!0},entries:{enumerable:!0},getFileHandle:{enumerable:!0},removeEntry:{enumerable:!0}});if(globalThis.FileSystemDirectoryHandle){const a=globalThis.FileSystemDirectoryHandle.prototype;a.resolve=async function(o){if(await o.isSameEntry(this))return[];const s=[{handle:this,path:[]}];for(;s.length;){let{handle:y,path:l}=s.pop();for await(const c of y.values()){if(await c.isSameEntry(o))return[...l,c.name];c.kind==="directory"&&s.push({handle:c,path:[...l,c.name]})}}return null};async function t(n){if(await(await navigator.storage.getDirectory()).resolve(n)===null)throw new DOMException(...oe)}const e=a.entries;a.entries=async function*(){await t(this),yield*e.call(this)},a[Symbol.asyncIterator]=async function*(){yield*this.entries()};const r=a.removeEntry;a.removeEntry=async function(n,o={}){return r.call(this,n,o).catch(async s=>{throw s instanceof DOMException&&s.name==="UnknownError"&&!o.recursive&&!(await e.call(this).next()).done?new DOMException(...se):s})}}const D=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:F,default:F},Symbol.toStringTag,{value:"Module"})),{INVALID:le,SYNTAX:I,GONE:ce}=x,v=Symbol("adapter");var U,C;class E extends(C=P,U=v,C){constructor(e){super(e);g(this,U);this[v]=e}async createWritable(e={}){return new p(await this[v].createWritable(e))}async getFile(){return this[v].getFile()}}Object.defineProperty(E.prototype,Symbol.toStringTag,{value:"FileSystemFileHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(E.prototype,{createWritable:{enumerable:!0},getFile:{enumerable:!0}});if(globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable){const a=new WeakMap;let t;const e=()=>{let n,o;onmessage=async s=>{const y=s.ports[0],l=s.data;switch(l.type){case"open":const c=l.name;let f=await navigator.storage.getDirectory();for(const w of l.path)f=await f.getDirectoryHandle(w);n=await f.getFileHandle(c),o=await n.createSyncAccessHandle();break;case"write":o.write(l.data,{at:l.position}),o.flush();break;case"truncate":o.truncate(l.size);break;case"abort":case"close":o.close();break}y.postMessage(0)}};globalThis.FileSystemFileHandle.prototype.createWritable=async function(n){if(!t){const i=`(${e.toString()})()`,S=new Blob([i],{type:"text/javascript"});t=URL.createObjectURL(S)}const o=new Worker(t,{type:"module"});let s=0;const y=new TextEncoder;let l=await this.getFile().then(i=>i.size);const c=i=>new Promise((S,O)=>{const h=new MessageChannel;h.port1.onmessage=A=>{A.data instanceof Error?O(A.data):S(A.data),h.port1.close(),h.port2.close(),h.port1.onmessage=null},o.postMessage(i,[h.port2])}),f=await navigator.storage.getDirectory(),w=await a.get(this),b=await f.resolve(w);if(b===null)throw new DOMException(...ce);return await c({type:"open",path:b,name:this.name}),(n==null?void 0:n.keepExistingData)===!1&&(await c({type:"truncate",size:0}),l=0),new p({start:i=>{},async write(i){if((i==null?void 0:i.constructor)===Object?i={...i}:i={type:"write",data:i,position:s},i.type==="write"){if(!("data"in i))throw await c({type:"close"}),new DOMException(...I("write requires a data argument"));if(i.position??(i.position=s),typeof i.data=="string")i.data=y.encode(i.data);else if(i.data instanceof ArrayBuffer)i.data=new Uint8Array(i.data);else if(!(i.data instanceof Uint8Array)&&ArrayBuffer.isView(i.data))i.data=new Uint8Array(i.data.buffer,i.data.byteOffset,i.data.byteLength);else if(!(i.data instanceof Uint8Array)){const O=await new Response(i.data).arrayBuffer();i.data=new Uint8Array(O)}Number.isInteger(i.position)&&i.position>=0&&(s=i.position),s+=i.data.byteLength,l+=i.data.byteLength}else if(i.type==="seek")if(Number.isInteger(i.position)&&i.position>=0){if(l<i.position)throw new DOMException(...le);console.log("seeking",i),s=i.position;return}else throw await c({type:"close"}),new DOMException(...I("seek requires a position argument"));else if(i.type==="truncate")if(Number.isInteger(i.size)&&i.size>=0)l=i.size,s>l&&(s=l);else throw await c({type:"close"}),new DOMException(...I("truncate requires a size argument"));await c(i)},async close(){await c({type:"close"}),o.terminate()},async abort(i){await c({type:"abort",reason:i}),o.terminate()}})};const r=FileSystemDirectoryHandle.prototype.getFileHandle;FileSystemDirectoryHandle.prototype.getFileHandle=async function(...n){const o=await r.call(this,...n);return a.set(o,this),o}}const _=Object.freeze(Object.defineProperty({__proto__:null,FileSystemFileHandle:E,default:E},Symbol.toStringTag,{value:"Module"})),ue=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:F,FileSystemFileHandle:E,FileSystemHandle:P,FileSystemWritableFileStream:p,getOriginPrivateDirectory:Z,showDirectoryPicker:k,showOpenFilePicker:K,showSaveFilePicker:Q},Symbol.toStringTag,{value:"Module"}));export{ue as a,ee as c,x as e};
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./downloader.CM5asV91.js","./index.PoIwzrI7.js","../css/index.C6rq3aMZ.css","./sandbox.BZyTt4zT.js","./memory.BWtwV556.js"])))=>i.map(i=>d[i]);
|
2
|
+
var G=Object.defineProperty;var R=a=>{throw TypeError(a)};var Y=(a,t,e)=>t in a?G(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var g=(a,t,e)=>Y(a,typeof t!="symbol"?t+"":t,e),X=(a,t,e)=>t.has(a)||R("Cannot "+e);var j=(a,t,e)=>t.has(a)?R("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(a):t.set(a,e),M=(a,t,e,r)=>(X(a,t,"write to private field"),r?r.call(a,e):t.set(a,e),e);import{y as d}from"./index.PoIwzrI7.js";const N=globalThis.showDirectoryPicker;async function k(a={}){if(N&&!a._preferPolyfill)return N(a);const t=document.createElement("input");t.type="file",t.webkitdirectory=!0,t.multiple=!0,t.style.position="fixed",t.style.top="-100000px",t.style.left="-100000px",document.body.appendChild(t);const e=d(()=>Promise.resolve().then(()=>B),void 0,import.meta.url);return await new Promise(r=>{t.addEventListener("change",r),t.click()}),e.then(r=>r.getDirHandlesFromInput(t))}const J={accepts:[]},V=globalThis.showOpenFilePicker;async function K(a={}){const t={...J,...a};if(V&&!a._preferPolyfill)return V(t);const e=document.createElement("input");e.type="file",e.multiple=t.multiple,e.accept=(t.accepts||[]).map(n=>[...(n.extensions||[]).map(o=>"."+o),...n.mimeTypes||[]]).flat().join(","),Object.assign(e.style,{position:"fixed",top:"-100000px",left:"-100000px"}),document.body.appendChild(e);const r=d(()=>Promise.resolve().then(()=>B),void 0,import.meta.url);return await new Promise(n=>{e.addEventListener("change",n,{once:!0}),e.click()}),e.remove(),r.then(n=>n.getFileHandlesFromInput(e))}const W=globalThis.showSaveFilePicker;async function Q(a={}){if(W&&!a._preferPolyfill)return W(a);a._name&&(console.warn("deprecated _name, spec now have `suggestedName`"),a.suggestedName=a._name);const{FileSystemFileHandle:t}=await d(async()=>{const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:r}},void 0,import.meta.url),{FileHandle:e}=await d(async()=>{const{FileHandle:r}=await import("./downloader.CM5asV91.js");return{FileHandle:r}},__vite__mapDeps([0,1,2]),import.meta.url);return new t(new e(a.suggestedName))}globalThis.DataTransferItem&&!DataTransferItem.prototype.getAsFileSystemHandle&&(DataTransferItem.prototype.getAsFileSystemHandle=async function(){const a=this.webkitGetAsEntry(),[{FileHandle:t,FolderHandle:e},{FileSystemDirectoryHandle:r},{FileSystemFileHandle:n}]=await Promise.all([d(()=>import("./sandbox.BZyTt4zT.js"),__vite__mapDeps([3,1,2]),import.meta.url),d(()=>Promise.resolve().then(()=>D),void 0,import.meta.url),d(()=>Promise.resolve().then(()=>_),void 0,import.meta.url)]);return a.isFile?new n(new t(a,!1)):new r(new e(a,!1))});async function Z(a,t={}){var o,s;if(!a)return((s=(o=globalThis.navigator)==null?void 0:o.storage)==null?void 0:s.getDirectory())||globalThis.getOriginPrivateDirectory();const{FileSystemDirectoryHandle:e}=await d(async()=>{const{FileSystemDirectoryHandle:y}=await Promise.resolve().then(()=>D);return{FileSystemDirectoryHandle:y}},void 0,import.meta.url),r=await a,n=await(r.default?r.default(t):r(t));return new e(n)}const ee={WritableStream:globalThis.WritableStream,TransformStream:globalThis.TransformStream,DOMException:globalThis.DOMException,Blob:globalThis.Blob,File:globalThis.File},{WritableStream:te}=ee;var H;const L=class L extends te{constructor(e){super(e);j(this,H);M(this,H,e),Object.setPrototypeOf(this,L.prototype),this._closed=!1}async close(){this._closed=!0;const e=this.getWriter(),r=e.close();return e.releaseLock(),r}seek(e){return this.write({type:"seek",position:e})}truncate(e){return this.write({type:"truncate",size:e})}write(e){if(this._closed)return Promise.reject(new TypeError("Cannot write to a CLOSED writable stream"));const r=this.getWriter(),n=r.write(e);return r.releaseLock(),n}};H=new WeakMap;let p=L;Object.defineProperty(p.prototype,Symbol.toStringTag,{value:"FileSystemWritableFileStream",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(p.prototype,{close:{enumerable:!0},seek:{enumerable:!0},truncate:{enumerable:!0},write:{enumerable:!0}});globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable&&!globalThis.FileSystemWritableFileStream&&(globalThis.FileSystemWritableFileStream=p);const m=Symbol("adapter");var q;q=m;class P{constructor(t){g(this,q);g(this,"name");g(this,"kind");this.kind=t.kind,this.name=t.name,this[m]=t}async queryPermission(t={}){const{mode:e="read"}=t,r=this[m];if(r.queryPermission)return r.queryPermission({mode:e});if(e==="read")return"granted";if(e==="readwrite")return r.writable?"granted":"denied";throw new TypeError(`Mode ${e} must be 'read' or 'readwrite'`)}async requestPermission({mode:t="read"}={}){const e=this[m];if(e.requestPermission)return e.requestPermission({mode:t});if(t==="read")return"granted";if(t==="readwrite")return e.writable?"granted":"denied";throw new TypeError(`Mode ${t} must be 'read' or 'readwrite'`)}async remove(t={}){await this[m].remove(t)}async isSameEntry(t){return this===t?!0:!t||typeof t!="object"||this.kind!==t.kind||!t[m]?!1:this[m].isSameEntry(t[m])}}Object.defineProperty(P.prototype,Symbol.toStringTag,{value:"FileSystemHandle",writable:!1,enumerable:!1,configurable:!0});var $;globalThis.FileSystemHandle&&(($=globalThis.FileSystemHandle.prototype).queryPermission??($.queryPermission=function(a){return"granted"}));const x={INVALID:["seeking position failed.","InvalidStateError"],GONE:["A requested file or directory could not be found at the time an operation was processed.","NotFoundError"],MISMATCH:["The path supplied exists, but was not an entry of requested type.","TypeMismatchError"],MOD_ERR:["The object can not be modified in this way.","InvalidModificationError"],SYNTAX:a=>[`Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. ${a}`,"SyntaxError"],SECURITY:["It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources.","SecurityError"],DISALLOWED:["The request is not allowed by the user agent or the platform in the current context.","NotAllowedError"]},re={writable:globalThis.WritableStream};async function ae(a){console.warn("deprecated fromDataTransfer - use `dt.items[0].getAsFileSystemHandle()` instead");const[t,e,r]=await Promise.all([d(()=>import("./memory.BWtwV556.js"),__vite__mapDeps([4,1,2]),import.meta.url),d(()=>import("./sandbox.BZyTt4zT.js"),__vite__mapDeps([3,1,2]),import.meta.url),d(()=>Promise.resolve().then(()=>D),void 0,import.meta.url)]),n=new t.FolderHandle("",!1);return n._entries=a.map(o=>o.isFile?new e.FileHandle(o,!1):new e.FolderHandle(o,!1)),new r.FileSystemDirectoryHandle(n)}async function ie(a){const{FolderHandle:t,FileHandle:e}=await d(async()=>{const{FolderHandle:y,FileHandle:l}=await import("./memory.BWtwV556.js");return{FolderHandle:y,FileHandle:l}},__vite__mapDeps([4,1,2]),import.meta.url),{FileSystemDirectoryHandle:r}=await d(async()=>{const{FileSystemDirectoryHandle:y}=await Promise.resolve().then(()=>D);return{FileSystemDirectoryHandle:y}},void 0,import.meta.url),n=Array.from(a.files),o=n[0].webkitRelativePath.split("/",1)[0],s=new t(o,!1);return n.forEach(y=>{const l=y.webkitRelativePath.split("/");l.shift();const c=l.pop(),f=l.reduce((w,b)=>(w._entries[b]||(w._entries[b]=new t(b,!1)),w._entries[b]),s);f._entries[c]=new e(y.name,y,!1)}),new r(s)}async function ne(a){const{FileHandle:t}=await d(async()=>{const{FileHandle:r}=await import("./memory.BWtwV556.js");return{FileHandle:r}},__vite__mapDeps([4,1,2]),import.meta.url),{FileSystemFileHandle:e}=await d(async()=>{const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:r}},void 0,import.meta.url);return Array.from(a.files).map(r=>new e(new t(r.name,r,!1)))}const B=Object.freeze(Object.defineProperty({__proto__:null,config:re,errors:x,fromDataTransfer:ae,getDirHandlesFromInput:ie,getFileHandlesFromInput:ne},Symbol.toStringTag,{value:"Module"})),{GONE:oe,MOD_ERR:se}=x,u=Symbol("adapter");var z;let F=class T extends P{constructor(e){super(e);g(this,z);this[u]=e}async getDirectoryHandle(e,r={}){if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");r.create=!!r.create;const n=await this[u].getDirectoryHandle(e,r);return new T(n)}async*entries(){const{FileSystemFileHandle:e}=await d(async()=>{const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:r}},void 0,import.meta.url);for await(const[r,n]of this[u].entries())yield[n.name,n.kind==="file"?new e(n):new T(n)]}async*getEntries(){const{FileSystemFileHandle:e}=await d(async()=>{const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:r}},void 0,import.meta.url);console.warn("deprecated, use .entries() instead");for await(let r of this[u].entries())yield r.kind==="file"?new e(r):new T(r)}async getFileHandle(e,r={}){const{FileSystemFileHandle:n}=await d(async()=>{const{FileSystemFileHandle:s}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:s}},void 0,import.meta.url);if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");r.create=!!r.create;const o=await this[u].getFileHandle(e,r);return new n(o)}async removeEntry(e,r={}){if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");return r.recursive=!!r.recursive,this[u].removeEntry(e,r)}async resolve(e){if(await e.isSameEntry(this))return[];const r=[{handle:this,path:[]}];for(;r.length;){let{handle:n,path:o}=r.pop();for await(const s of n.values()){if(await s.isSameEntry(e))return[...o,s.name];s.kind==="directory"&&r.push({handle:s,path:[...o,s.name]})}}return null}async*keys(){for await(const[e]of this[u].entries())yield e}async*values(){for await(const[e,r]of this)yield r}[(z=u,Symbol.asyncIterator)](){return this.entries()}};Object.defineProperty(F.prototype,Symbol.toStringTag,{value:"FileSystemDirectoryHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(F.prototype,{getDirectoryHandle:{enumerable:!0},entries:{enumerable:!0},getFileHandle:{enumerable:!0},removeEntry:{enumerable:!0}});if(globalThis.FileSystemDirectoryHandle){const a=globalThis.FileSystemDirectoryHandle.prototype;a.resolve=async function(o){if(await o.isSameEntry(this))return[];const s=[{handle:this,path:[]}];for(;s.length;){let{handle:y,path:l}=s.pop();for await(const c of y.values()){if(await c.isSameEntry(o))return[...l,c.name];c.kind==="directory"&&s.push({handle:c,path:[...l,c.name]})}}return null};async function t(n){if(await(await navigator.storage.getDirectory()).resolve(n)===null)throw new DOMException(...oe)}const e=a.entries;a.entries=async function*(){await t(this),yield*e.call(this)},a[Symbol.asyncIterator]=async function*(){yield*this.entries()};const r=a.removeEntry;a.removeEntry=async function(n,o={}){return r.call(this,n,o).catch(async s=>{throw s instanceof DOMException&&s.name==="UnknownError"&&!o.recursive&&!(await e.call(this).next()).done?new DOMException(...se):s})}}const D=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:F,default:F},Symbol.toStringTag,{value:"Module"})),{INVALID:le,SYNTAX:I,GONE:ce}=x,v=Symbol("adapter");var U,C;class E extends(C=P,U=v,C){constructor(e){super(e);g(this,U);this[v]=e}async createWritable(e={}){return new p(await this[v].createWritable(e))}async getFile(){return this[v].getFile()}}Object.defineProperty(E.prototype,Symbol.toStringTag,{value:"FileSystemFileHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(E.prototype,{createWritable:{enumerable:!0},getFile:{enumerable:!0}});if(globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable){const a=new WeakMap;let t;const e=()=>{let n,o;onmessage=async s=>{const y=s.ports[0],l=s.data;switch(l.type){case"open":const c=l.name;let f=await navigator.storage.getDirectory();for(const w of l.path)f=await f.getDirectoryHandle(w);n=await f.getFileHandle(c),o=await n.createSyncAccessHandle();break;case"write":o.write(l.data,{at:l.position}),o.flush();break;case"truncate":o.truncate(l.size);break;case"abort":case"close":o.close();break}y.postMessage(0)}};globalThis.FileSystemFileHandle.prototype.createWritable=async function(n){if(!t){const i=`(${e.toString()})()`,S=new Blob([i],{type:"text/javascript"});t=URL.createObjectURL(S)}const o=new Worker(t,{type:"module"});let s=0;const y=new TextEncoder;let l=await this.getFile().then(i=>i.size);const c=i=>new Promise((S,O)=>{const h=new MessageChannel;h.port1.onmessage=A=>{A.data instanceof Error?O(A.data):S(A.data),h.port1.close(),h.port2.close(),h.port1.onmessage=null},o.postMessage(i,[h.port2])}),f=await navigator.storage.getDirectory(),w=await a.get(this),b=await f.resolve(w);if(b===null)throw new DOMException(...ce);return await c({type:"open",path:b,name:this.name}),(n==null?void 0:n.keepExistingData)===!1&&(await c({type:"truncate",size:0}),l=0),new p({start:i=>{},async write(i){if((i==null?void 0:i.constructor)===Object?i={...i}:i={type:"write",data:i,position:s},i.type==="write"){if(!("data"in i))throw await c({type:"close"}),new DOMException(...I("write requires a data argument"));if(i.position??(i.position=s),typeof i.data=="string")i.data=y.encode(i.data);else if(i.data instanceof ArrayBuffer)i.data=new Uint8Array(i.data);else if(!(i.data instanceof Uint8Array)&&ArrayBuffer.isView(i.data))i.data=new Uint8Array(i.data.buffer,i.data.byteOffset,i.data.byteLength);else if(!(i.data instanceof Uint8Array)){const O=await new Response(i.data).arrayBuffer();i.data=new Uint8Array(O)}Number.isInteger(i.position)&&i.position>=0&&(s=i.position),s+=i.data.byteLength,l+=i.data.byteLength}else if(i.type==="seek")if(Number.isInteger(i.position)&&i.position>=0){if(l<i.position)throw new DOMException(...le);console.log("seeking",i),s=i.position;return}else throw await c({type:"close"}),new DOMException(...I("seek requires a position argument"));else if(i.type==="truncate")if(Number.isInteger(i.size)&&i.size>=0)l=i.size,s>l&&(s=l);else throw await c({type:"close"}),new DOMException(...I("truncate requires a size argument"));await c(i)},async close(){await c({type:"close"}),o.terminate()},async abort(i){await c({type:"abort",reason:i}),o.terminate()}})};const r=FileSystemDirectoryHandle.prototype.getFileHandle;FileSystemDirectoryHandle.prototype.getFileHandle=async function(...n){const o=await r.call(this,...n);return a.set(o,this),o}}const _=Object.freeze(Object.defineProperty({__proto__:null,FileSystemFileHandle:E,default:E},Symbol.toStringTag,{value:"Module"})),ue=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:F,FileSystemFileHandle:E,FileSystemHandle:P,FileSystemWritableFileStream:p,getOriginPrivateDirectory:Z,showDirectoryPicker:k,showOpenFilePicker:K,showSaveFilePicker:Q},Symbol.toStringTag,{value:"Module"}));export{ue as a,ee as c,x as e};
|
@@ -1 +1 @@
|
|
1
|
-
import{g as ot}from"./index.C2qCX1Lh.js";function rt(k,u){for(var p=0;p<u.length;p++){const I=u[p];if(typeof I!="string"&&!Array.isArray(I)){for(const E in I)if(E!=="default"&&!(E in k)){const O=Object.getOwnPropertyDescriptor(I,E);O&&Object.defineProperty(k,E,O.get?O:{enumerable:!0,get:()=>I[E]})}}}return Object.freeze(Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}))}var oe={exports:{}},xe;function at(){return xe||(xe=1,function(k){(function(u){if(typeof window>"u")return;var p=!0,I=10,E="",O=0,D="",_=null,re="",W=!1,Ne={resize:1,click:1},V=128,ae=!0,P=1,U="bodyOffset",h=U,se=!0,ce="",R={},S=32,ue=null,J=!1,X=!1,H="[iFrameSizer]",le=H.length,B="",fe={max:1,min:1,bodyScroll:1,documentElementScroll:1},Y="child",de=window.parent,x="*",K=0,j=!1,me=null,A=16,N=1,ge="scroll",v=ge,De=window,Q=function(){T("onMessage function not defined")},G=function(){},Z=function(){},$={height:function(){return T("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return T("Custom width calculation function not defined"),document.body.scrollWidth}},ee={},he=!1;function pe(){}try{var ve=Object.create({},{passive:{get:function(){he=!0}}});window.addEventListener("test",pe,ve),window.removeEventListener("test",pe,ve)}catch{}function z(e,t,n,i){e.addEventListener(t,n,he?i||{}:!1)}function We(e,t,n){e.removeEventListener(t,n,!1)}function ye(e){return e.charAt(0).toUpperCase()+e.slice(1)}function He(e){var t,n,i,a=null,f=0,m=function(){f=Date.now(),a=null,i=e.apply(t,n),a||(t=n=null)};return function(){var d=Date.now();f||(f=d);var s=A-(d-f);return t=this,n=arguments,s<=0||s>A?(a&&(clearTimeout(a),a=null),f=d,i=e.apply(t,n),a||(t=n=null)):a||(a=setTimeout(m,s)),i}}function we(e){return H+"["+B+"] "+e}function o(e){J&&typeof window.console=="object"&&console.log(we(e))}function T(e){typeof window.console=="object"&&console.warn(we(e))}function Be(){je(),o("Initialising iFrame ("+window.location.href+")"),_e(),Ue(),te("background",E),te("padding",re),Ke(),Me(),Ee(),Je(),Ze(),Ge(),Ie(),R=Qe(),L("init","Init message from host page"),G()}function je(){function e(n){return n==="true"}var t=ce.slice(le).split(":");B=t[0],O=u===t[1]?O:Number(t[1]),W=u===t[2]?W:e(t[2]),J=u===t[3]?J:e(t[3]),S=u===t[4]?S:Number(t[4]),p=u===t[6]?p:e(t[6]),D=t[7],h=u===t[8]?h:t[8],E=t[9],re=t[10],K=u===t[11]?K:Number(t[11]),R.enable=u===t[12]?!1:e(t[12]),Y=u===t[13]?Y:t[13],v=u===t[14]?v:t[14],X=u===t[15]?X:e(t[15])}function qe(e){var t=e.split("Callback");if(t.length===2){var n="on"+t[0].charAt(0).toUpperCase()+t[0].slice(1);this[n]=this[e],delete this[e],T("Deprecated: '"+e+"' has been renamed '"+n+"'. The old method will be removed in the next major version.")}}function _e(){function e(){var n=window.iFrameResizer;o("Reading data from page: "+JSON.stringify(n)),Object.keys(n).forEach(qe,n),Q="onMessage"in n?n.onMessage:Q,G="onReady"in n?n.onReady:G,x="targetOrigin"in n?n.targetOrigin:x,h="heightCalculationMethod"in n?n.heightCalculationMethod:h,v="widthCalculationMethod"in n?n.widthCalculationMethod:v}function t(n,i){return typeof n=="function"&&(o("Setup custom "+i+"CalcMethod"),$[i]=n,n="custom"),n}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),h=t(h,"height"),v=t(v,"width")),o("TargetOrigin for parent set to: "+x)}function Ve(e,t){return t.indexOf("-")!==-1&&(T("Negative CSS value ignored for "+e),t=""),t}function te(e,t){u!==t&&t!==""&&t!=="null"&&(document.body.style[e]=t,o("Body "+e+' set to "'+t+'"'))}function Ue(){u===D&&(D=O+"px"),te("margin",Ve("margin",D))}function Je(){document.documentElement.style.height="",document.body.style.height="",o('HTML & body height set to "auto"')}function g(e){var t={add:function(n){function i(){L(e.eventName,e.eventType)}ee[n]=i,z(window,n,i,{passive:!0})},remove:function(n){var i=ee[n];delete ee[n],We(window,n,i)}};e.eventNames&&Array.prototype.map?(e.eventName=e.eventNames[0],e.eventNames.map(t[e.method])):t[e.method](e.eventName),o(ye(e.method)+" event listener: "+e.eventType)}function be(e){g({method:e,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),g({method:e,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),g({method:e,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),g({method:e,eventType:"Input",eventName:"input"}),g({method:e,eventType:"Mouse Up",eventName:"mouseup"}),g({method:e,eventType:"Mouse Down",eventName:"mousedown"}),g({method:e,eventType:"Orientation Change",eventName:"orientationchange"}),g({method:e,eventType:"Print",eventNames:["afterprint","beforeprint"]}),g({method:e,eventType:"Ready State Change",eventName:"readystatechange"}),g({method:e,eventType:"Touch Start",eventName:"touchstart"}),g({method:e,eventType:"Touch End",eventName:"touchend"}),g({method:e,eventType:"Touch Cancel",eventName:"touchcancel"}),g({method:e,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),g({method:e,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),g({method:e,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),Y==="child"&&g({method:e,eventType:"IFrame Resized",eventName:"resize"})}function Te(e,t,n,i){return t!==e&&(e in n||(T(e+" is not a valid option for "+i+"CalculationMethod."),e=t),o(i+' calculation method set to "'+e+'"')),e}function Me(){h=Te(h,U,M,"height")}function Ee(){v=Te(v,ge,F,"width")}function Ie(){p===!0?(be("add"),et()):o("Auto Resize disabled")}function Xe(){_!==null&&_.disconnect()}function Ye(){be("remove"),Xe(),clearInterval(ue)}function Ke(){var e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.appendChild(e)}function Qe(){function e(){return{x:window.pageXOffset===u?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===u?document.documentElement.scrollTop:window.pageYOffset}}function t(s){var l=s.getBoundingClientRect(),c=e();return{x:parseInt(l.left,10)+parseInt(c.x,10),y:parseInt(l.top,10)+parseInt(c.y,10)}}function n(s){function l(b){var C=t(b);o("Moving to in page link (#"+c+") at x: "+C.x+" y: "+C.y),y(C.y,C.x,"scrollToOffset")}var c=s.split("#")[1]||s,r=decodeURIComponent(c),w=document.getElementById(r)||document.getElementsByName(r)[0];u===w?(o("In page link (#"+c+") not found in iFrame, so sending to parent"),y(0,0,"inPageLink","#"+c)):l(w)}function i(){var s=window.location.hash,l=window.location.href;s!==""&&s!=="#"&&n(l)}function a(){function s(l){function c(r){r.preventDefault(),n(this.getAttribute("href"))}l.getAttribute("href")!=="#"&&z(l,"click",c)}Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),s)}function f(){z(window,"hashchange",i)}function m(){setTimeout(i,V)}function d(){Array.prototype.forEach&&document.querySelectorAll?(o("Setting up location.hash handlers"),a(),f(),m()):T("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return R.enable?d():o("In page linking not enabled"),{findTarget:n}}function Ge(){if(X!==!0)return;function e(n){y(0,0,n.type,n.screenY+":"+n.screenX)}function t(n,i){o("Add event listener: "+i),z(window.document,n,e)}t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave")}function Ze(){o("Enable public methods"),De.parentIFrame={autoResize:function(t){return t===!0&&p===!1?(p=!0,Ie()):t===!1&&p===!0&&(p=!1,Ye()),y(0,0,"autoResize",JSON.stringify(p)),p},close:function(){y(0,0,"close")},getId:function(){return B},getPageInfo:function(t){typeof t=="function"?(Z=t,y(0,0,"pageInfo")):(Z=function(){},y(0,0,"pageInfoStop"))},moveToAnchor:function(t){R.findTarget(t)},reset:function(){ke("parentIFrame.reset")},scrollTo:function(t,n){y(n,t,"scrollTo")},scrollToOffset:function(t,n){y(n,t,"scrollToOffset")},sendMessage:function(t,n){y(0,0,"message",JSON.stringify(t),n)},setHeightCalculationMethod:function(t){h=t,Me()},setWidthCalculationMethod:function(t){v=t,Ee()},setTargetOrigin:function(t){o("Set targetOrigin: "+t),x=t},size:function(t,n){var i=""+(t||"")+(n?","+n:"");L("size","parentIFrame.size("+i+")",t,n)}}}function Oe(){S!==0&&(o("setInterval: "+S+"ms"),ue=setInterval(function(){L("interval","setInterval: "+S)},Math.abs(S)))}function $e(){function e(r){function w(b){b.complete===!1&&(o("Attach listeners to "+b.src),b.addEventListener("load",a,!1),b.addEventListener("error",f,!1),s.push(b))}r.type==="attributes"&&r.attributeName==="src"?w(r.target):r.type==="childList"&&Array.prototype.forEach.call(r.target.querySelectorAll("img"),w)}function t(r){s.splice(s.indexOf(r),1)}function n(r){o("Remove listeners from "+r.src),r.removeEventListener("load",a,!1),r.removeEventListener("error",f,!1),t(r)}function i(r,w,b){n(r.target),L(w,b+": "+r.target.src)}function a(r){i(r,"imageLoad","Image loaded")}function f(r){i(r,"imageLoadFailed","Image load failed")}function m(r){L("mutationObserver","mutationObserver: "+r[0].target+" "+r[0].type),r.forEach(e)}function d(){var r=document.querySelector("body"),w={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0};return c=new l(m),o("Create body MutationObserver"),c.observe(r,w),c}var s=[],l=window.MutationObserver||window.WebKitMutationObserver,c=d();return{disconnect:function(){"disconnect"in c&&(o("Disconnect body MutationObserver"),c.disconnect(),s.forEach(n))}}}function et(){var e=0>S;window.MutationObserver||window.WebKitMutationObserver?e?Oe():_=$e():(o("MutationObserver not supported in this browser!"),Oe())}function ne(e,t){var n=0;return t=t||document.body,n=document.defaultView.getComputedStyle(t,null),n=n===null?0:n[e],parseInt(n,I)}function tt(e){e>A/2&&(A=2*e,o("Event throttle increased to "+A+"ms"))}function ie(e,t){for(var n=t.length,i=0,a=0,f=ye(e),m=Date.now(),d=0;d<n;d++)i=t[d].getBoundingClientRect()[e]+ne("margin"+f,t[d]),i>a&&(a=i);return m=Date.now()-m,o("Parsed "+n+" HTML elements"),o("Element position calculated in "+m+"ms"),tt(m),a}function q(e){return[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll()]}function Se(e,t){function n(){return T("No tagged elements ("+t+") found on page"),document.querySelectorAll("body *")}var i=document.querySelectorAll("["+t+"]");return i.length===0&&n(),ie(e,i)}function Fe(){return document.querySelectorAll("body *")}var M={bodyOffset:function(){return document.body.offsetHeight+ne("marginTop")+ne("marginBottom")},offset:function(){return M.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return $.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,q(M))},min:function(){return Math.min.apply(null,q(M))},grow:function(){return M.max()},lowestElement:function(){return Math.max(M.bodyOffset()||M.documentElementOffset(),ie("bottom",Fe()))},taggedElement:function(){return Se("bottom","data-iframe-height")}},F={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return $.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(F.bodyScroll(),F.documentElementScroll())},max:function(){return Math.max.apply(null,q(F))},min:function(){return Math.min.apply(null,q(F))},rightMostElement:function(){return ie("right",Fe())},taggedElement:function(){return Se("right","data-iframe-width")}};function Le(e,t,n,i){function a(){P=c,N=r,y(P,N,e)}function f(){function w(b,C){var it=Math.abs(b-C)<=K;return!it}return c=u===n?M[h]():n,r=u===i?F[v]():i,w(P,c)||W&&w(N,r)}function m(){return!(e in{init:1,interval:1,size:1})}function d(){return h in fe||W&&v in fe}function s(){o("No change in size detected")}function l(){m()&&d()?ke(t):e in{interval:1}||s()}var c,r;f()||e==="init"?(ze(),a()):l()}var nt=He(Le);function L(e,t,n,i){function a(){e in{reset:1,resetPage:1,init:1}||o("Trigger event: "+t)}function f(){return j&&e in Ne}f()?o("Trigger event cancelled: "+e):(a(),e==="init"?Le(e,t,n,i):nt(e,t,n,i))}function ze(){j||(j=!0,o("Trigger event lock on")),clearTimeout(me),me=setTimeout(function(){j=!1,o("Trigger event lock off"),o("--")},V)}function Ce(e){P=M[h](),N=F[v](),y(P,N,e)}function ke(e){var t=h;h=U,o("Reset trigger event: "+e),ze(),Ce("reset"),h=t}function y(e,t,n,i,a){function f(){u===a?a=x:o("Message targetOrigin: "+a)}function m(){var d=e+":"+t,s=B+":"+d+":"+n+(u===i?"":":"+i);o("Sending message to host page ("+s+")"),de.postMessage(H+s,a)}f(),m()}function Pe(e){var t={init:function(){ce=e.data,de=e.source,Be(),ae=!1,setTimeout(function(){se=!1},V)},reset:function(){se?o("Page reset ignored by init"):(o("Page size reset by host page"),Ce("resetPage"))},resize:function(){L("resizeParent","Parent window requested size check")},moveToAnchor:function(){R.findTarget(a())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var c=a();o("PageInfoFromParent called from parent: "+c),Z(JSON.parse(c)),o(" --")},message:function(){var c=a();o("onMessage called from parent: "+c),Q(JSON.parse(c)),o(" --")}};function n(){return H===(""+e.data).slice(0,le)}function i(){return e.data.split("]")[1].split(":")[0]}function a(){return e.data.slice(e.data.indexOf(":")+1)}function f(){return!k.exports&&"iFrameResize"in window||window.jQuery!==u&&"iFrameResize"in window.jQuery.prototype}function m(){return e.data.split(":")[2]in{true:1,false:1}}function d(){var l=i();l in t?t[l]():!f()&&!m()&&T("Unexpected message ("+e.data+")")}function s(){ae===!1?d():m()?t.init():o('Ignored message of type "'+i()+'". Received before initialization.')}n()&&s()}function Re(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeResizer"in window||(window.iframeChildListener=function(e){Pe({data:e})},z(window,"message",Pe),z(window,"readystatechange",Re),Re())})()}(oe)),oe.exports}var Ae=at();const st=ot(Ae),ut=rt({__proto__:null,default:st},[Ae]);export{ut as i};
|
1
|
+
import{g as ot}from"./index.PoIwzrI7.js";function rt(k,u){for(var p=0;p<u.length;p++){const I=u[p];if(typeof I!="string"&&!Array.isArray(I)){for(const E in I)if(E!=="default"&&!(E in k)){const O=Object.getOwnPropertyDescriptor(I,E);O&&Object.defineProperty(k,E,O.get?O:{enumerable:!0,get:()=>I[E]})}}}return Object.freeze(Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}))}var oe={exports:{}},xe;function at(){return xe||(xe=1,function(k){(function(u){if(typeof window>"u")return;var p=!0,I=10,E="",O=0,D="",_=null,re="",W=!1,Ne={resize:1,click:1},V=128,ae=!0,P=1,U="bodyOffset",h=U,se=!0,ce="",R={},S=32,ue=null,J=!1,X=!1,H="[iFrameSizer]",le=H.length,B="",fe={max:1,min:1,bodyScroll:1,documentElementScroll:1},Y="child",de=window.parent,x="*",K=0,j=!1,me=null,A=16,N=1,ge="scroll",v=ge,De=window,Q=function(){T("onMessage function not defined")},G=function(){},Z=function(){},$={height:function(){return T("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return T("Custom width calculation function not defined"),document.body.scrollWidth}},ee={},he=!1;function pe(){}try{var ve=Object.create({},{passive:{get:function(){he=!0}}});window.addEventListener("test",pe,ve),window.removeEventListener("test",pe,ve)}catch{}function z(e,t,n,i){e.addEventListener(t,n,he?i||{}:!1)}function We(e,t,n){e.removeEventListener(t,n,!1)}function ye(e){return e.charAt(0).toUpperCase()+e.slice(1)}function He(e){var t,n,i,a=null,f=0,m=function(){f=Date.now(),a=null,i=e.apply(t,n),a||(t=n=null)};return function(){var d=Date.now();f||(f=d);var s=A-(d-f);return t=this,n=arguments,s<=0||s>A?(a&&(clearTimeout(a),a=null),f=d,i=e.apply(t,n),a||(t=n=null)):a||(a=setTimeout(m,s)),i}}function we(e){return H+"["+B+"] "+e}function o(e){J&&typeof window.console=="object"&&console.log(we(e))}function T(e){typeof window.console=="object"&&console.warn(we(e))}function Be(){je(),o("Initialising iFrame ("+window.location.href+")"),_e(),Ue(),te("background",E),te("padding",re),Ke(),Me(),Ee(),Je(),Ze(),Ge(),Ie(),R=Qe(),L("init","Init message from host page"),G()}function je(){function e(n){return n==="true"}var t=ce.slice(le).split(":");B=t[0],O=u===t[1]?O:Number(t[1]),W=u===t[2]?W:e(t[2]),J=u===t[3]?J:e(t[3]),S=u===t[4]?S:Number(t[4]),p=u===t[6]?p:e(t[6]),D=t[7],h=u===t[8]?h:t[8],E=t[9],re=t[10],K=u===t[11]?K:Number(t[11]),R.enable=u===t[12]?!1:e(t[12]),Y=u===t[13]?Y:t[13],v=u===t[14]?v:t[14],X=u===t[15]?X:e(t[15])}function qe(e){var t=e.split("Callback");if(t.length===2){var n="on"+t[0].charAt(0).toUpperCase()+t[0].slice(1);this[n]=this[e],delete this[e],T("Deprecated: '"+e+"' has been renamed '"+n+"'. The old method will be removed in the next major version.")}}function _e(){function e(){var n=window.iFrameResizer;o("Reading data from page: "+JSON.stringify(n)),Object.keys(n).forEach(qe,n),Q="onMessage"in n?n.onMessage:Q,G="onReady"in n?n.onReady:G,x="targetOrigin"in n?n.targetOrigin:x,h="heightCalculationMethod"in n?n.heightCalculationMethod:h,v="widthCalculationMethod"in n?n.widthCalculationMethod:v}function t(n,i){return typeof n=="function"&&(o("Setup custom "+i+"CalcMethod"),$[i]=n,n="custom"),n}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),h=t(h,"height"),v=t(v,"width")),o("TargetOrigin for parent set to: "+x)}function Ve(e,t){return t.indexOf("-")!==-1&&(T("Negative CSS value ignored for "+e),t=""),t}function te(e,t){u!==t&&t!==""&&t!=="null"&&(document.body.style[e]=t,o("Body "+e+' set to "'+t+'"'))}function Ue(){u===D&&(D=O+"px"),te("margin",Ve("margin",D))}function Je(){document.documentElement.style.height="",document.body.style.height="",o('HTML & body height set to "auto"')}function g(e){var t={add:function(n){function i(){L(e.eventName,e.eventType)}ee[n]=i,z(window,n,i,{passive:!0})},remove:function(n){var i=ee[n];delete ee[n],We(window,n,i)}};e.eventNames&&Array.prototype.map?(e.eventName=e.eventNames[0],e.eventNames.map(t[e.method])):t[e.method](e.eventName),o(ye(e.method)+" event listener: "+e.eventType)}function be(e){g({method:e,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),g({method:e,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),g({method:e,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),g({method:e,eventType:"Input",eventName:"input"}),g({method:e,eventType:"Mouse Up",eventName:"mouseup"}),g({method:e,eventType:"Mouse Down",eventName:"mousedown"}),g({method:e,eventType:"Orientation Change",eventName:"orientationchange"}),g({method:e,eventType:"Print",eventNames:["afterprint","beforeprint"]}),g({method:e,eventType:"Ready State Change",eventName:"readystatechange"}),g({method:e,eventType:"Touch Start",eventName:"touchstart"}),g({method:e,eventType:"Touch End",eventName:"touchend"}),g({method:e,eventType:"Touch Cancel",eventName:"touchcancel"}),g({method:e,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),g({method:e,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),g({method:e,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),Y==="child"&&g({method:e,eventType:"IFrame Resized",eventName:"resize"})}function Te(e,t,n,i){return t!==e&&(e in n||(T(e+" is not a valid option for "+i+"CalculationMethod."),e=t),o(i+' calculation method set to "'+e+'"')),e}function Me(){h=Te(h,U,M,"height")}function Ee(){v=Te(v,ge,F,"width")}function Ie(){p===!0?(be("add"),et()):o("Auto Resize disabled")}function Xe(){_!==null&&_.disconnect()}function Ye(){be("remove"),Xe(),clearInterval(ue)}function Ke(){var e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.appendChild(e)}function Qe(){function e(){return{x:window.pageXOffset===u?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===u?document.documentElement.scrollTop:window.pageYOffset}}function t(s){var l=s.getBoundingClientRect(),c=e();return{x:parseInt(l.left,10)+parseInt(c.x,10),y:parseInt(l.top,10)+parseInt(c.y,10)}}function n(s){function l(b){var C=t(b);o("Moving to in page link (#"+c+") at x: "+C.x+" y: "+C.y),y(C.y,C.x,"scrollToOffset")}var c=s.split("#")[1]||s,r=decodeURIComponent(c),w=document.getElementById(r)||document.getElementsByName(r)[0];u===w?(o("In page link (#"+c+") not found in iFrame, so sending to parent"),y(0,0,"inPageLink","#"+c)):l(w)}function i(){var s=window.location.hash,l=window.location.href;s!==""&&s!=="#"&&n(l)}function a(){function s(l){function c(r){r.preventDefault(),n(this.getAttribute("href"))}l.getAttribute("href")!=="#"&&z(l,"click",c)}Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),s)}function f(){z(window,"hashchange",i)}function m(){setTimeout(i,V)}function d(){Array.prototype.forEach&&document.querySelectorAll?(o("Setting up location.hash handlers"),a(),f(),m()):T("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return R.enable?d():o("In page linking not enabled"),{findTarget:n}}function Ge(){if(X!==!0)return;function e(n){y(0,0,n.type,n.screenY+":"+n.screenX)}function t(n,i){o("Add event listener: "+i),z(window.document,n,e)}t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave")}function Ze(){o("Enable public methods"),De.parentIFrame={autoResize:function(t){return t===!0&&p===!1?(p=!0,Ie()):t===!1&&p===!0&&(p=!1,Ye()),y(0,0,"autoResize",JSON.stringify(p)),p},close:function(){y(0,0,"close")},getId:function(){return B},getPageInfo:function(t){typeof t=="function"?(Z=t,y(0,0,"pageInfo")):(Z=function(){},y(0,0,"pageInfoStop"))},moveToAnchor:function(t){R.findTarget(t)},reset:function(){ke("parentIFrame.reset")},scrollTo:function(t,n){y(n,t,"scrollTo")},scrollToOffset:function(t,n){y(n,t,"scrollToOffset")},sendMessage:function(t,n){y(0,0,"message",JSON.stringify(t),n)},setHeightCalculationMethod:function(t){h=t,Me()},setWidthCalculationMethod:function(t){v=t,Ee()},setTargetOrigin:function(t){o("Set targetOrigin: "+t),x=t},size:function(t,n){var i=""+(t||"")+(n?","+n:"");L("size","parentIFrame.size("+i+")",t,n)}}}function Oe(){S!==0&&(o("setInterval: "+S+"ms"),ue=setInterval(function(){L("interval","setInterval: "+S)},Math.abs(S)))}function $e(){function e(r){function w(b){b.complete===!1&&(o("Attach listeners to "+b.src),b.addEventListener("load",a,!1),b.addEventListener("error",f,!1),s.push(b))}r.type==="attributes"&&r.attributeName==="src"?w(r.target):r.type==="childList"&&Array.prototype.forEach.call(r.target.querySelectorAll("img"),w)}function t(r){s.splice(s.indexOf(r),1)}function n(r){o("Remove listeners from "+r.src),r.removeEventListener("load",a,!1),r.removeEventListener("error",f,!1),t(r)}function i(r,w,b){n(r.target),L(w,b+": "+r.target.src)}function a(r){i(r,"imageLoad","Image loaded")}function f(r){i(r,"imageLoadFailed","Image load failed")}function m(r){L("mutationObserver","mutationObserver: "+r[0].target+" "+r[0].type),r.forEach(e)}function d(){var r=document.querySelector("body"),w={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0};return c=new l(m),o("Create body MutationObserver"),c.observe(r,w),c}var s=[],l=window.MutationObserver||window.WebKitMutationObserver,c=d();return{disconnect:function(){"disconnect"in c&&(o("Disconnect body MutationObserver"),c.disconnect(),s.forEach(n))}}}function et(){var e=0>S;window.MutationObserver||window.WebKitMutationObserver?e?Oe():_=$e():(o("MutationObserver not supported in this browser!"),Oe())}function ne(e,t){var n=0;return t=t||document.body,n=document.defaultView.getComputedStyle(t,null),n=n===null?0:n[e],parseInt(n,I)}function tt(e){e>A/2&&(A=2*e,o("Event throttle increased to "+A+"ms"))}function ie(e,t){for(var n=t.length,i=0,a=0,f=ye(e),m=Date.now(),d=0;d<n;d++)i=t[d].getBoundingClientRect()[e]+ne("margin"+f,t[d]),i>a&&(a=i);return m=Date.now()-m,o("Parsed "+n+" HTML elements"),o("Element position calculated in "+m+"ms"),tt(m),a}function q(e){return[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll()]}function Se(e,t){function n(){return T("No tagged elements ("+t+") found on page"),document.querySelectorAll("body *")}var i=document.querySelectorAll("["+t+"]");return i.length===0&&n(),ie(e,i)}function Fe(){return document.querySelectorAll("body *")}var M={bodyOffset:function(){return document.body.offsetHeight+ne("marginTop")+ne("marginBottom")},offset:function(){return M.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return $.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,q(M))},min:function(){return Math.min.apply(null,q(M))},grow:function(){return M.max()},lowestElement:function(){return Math.max(M.bodyOffset()||M.documentElementOffset(),ie("bottom",Fe()))},taggedElement:function(){return Se("bottom","data-iframe-height")}},F={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return $.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(F.bodyScroll(),F.documentElementScroll())},max:function(){return Math.max.apply(null,q(F))},min:function(){return Math.min.apply(null,q(F))},rightMostElement:function(){return ie("right",Fe())},taggedElement:function(){return Se("right","data-iframe-width")}};function Le(e,t,n,i){function a(){P=c,N=r,y(P,N,e)}function f(){function w(b,C){var it=Math.abs(b-C)<=K;return!it}return c=u===n?M[h]():n,r=u===i?F[v]():i,w(P,c)||W&&w(N,r)}function m(){return!(e in{init:1,interval:1,size:1})}function d(){return h in fe||W&&v in fe}function s(){o("No change in size detected")}function l(){m()&&d()?ke(t):e in{interval:1}||s()}var c,r;f()||e==="init"?(ze(),a()):l()}var nt=He(Le);function L(e,t,n,i){function a(){e in{reset:1,resetPage:1,init:1}||o("Trigger event: "+t)}function f(){return j&&e in Ne}f()?o("Trigger event cancelled: "+e):(a(),e==="init"?Le(e,t,n,i):nt(e,t,n,i))}function ze(){j||(j=!0,o("Trigger event lock on")),clearTimeout(me),me=setTimeout(function(){j=!1,o("Trigger event lock off"),o("--")},V)}function Ce(e){P=M[h](),N=F[v](),y(P,N,e)}function ke(e){var t=h;h=U,o("Reset trigger event: "+e),ze(),Ce("reset"),h=t}function y(e,t,n,i,a){function f(){u===a?a=x:o("Message targetOrigin: "+a)}function m(){var d=e+":"+t,s=B+":"+d+":"+n+(u===i?"":":"+i);o("Sending message to host page ("+s+")"),de.postMessage(H+s,a)}f(),m()}function Pe(e){var t={init:function(){ce=e.data,de=e.source,Be(),ae=!1,setTimeout(function(){se=!1},V)},reset:function(){se?o("Page reset ignored by init"):(o("Page size reset by host page"),Ce("resetPage"))},resize:function(){L("resizeParent","Parent window requested size check")},moveToAnchor:function(){R.findTarget(a())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var c=a();o("PageInfoFromParent called from parent: "+c),Z(JSON.parse(c)),o(" --")},message:function(){var c=a();o("onMessage called from parent: "+c),Q(JSON.parse(c)),o(" --")}};function n(){return H===(""+e.data).slice(0,le)}function i(){return e.data.split("]")[1].split(":")[0]}function a(){return e.data.slice(e.data.indexOf(":")+1)}function f(){return!k.exports&&"iFrameResize"in window||window.jQuery!==u&&"iFrameResize"in window.jQuery.prototype}function m(){return e.data.split(":")[2]in{true:1,false:1}}function d(){var l=i();l in t?t[l]():!f()&&!m()&&T("Unexpected message ("+e.data+")")}function s(){ae===!1?d():m()?t.init():o('Ignored message of type "'+i()+'". Received before initialization.')}n()&&s()}function Re(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeResizer"in window||(window.iframeChildListener=function(e){Pe({data:e})},z(window,"message",Pe),z(window,"readystatechange",Re),Re())})()}(oe)),oe.exports}var Ae=at();const st=ot(Ae),ut=rt({__proto__:null,default:st},[Ae]);export{ut as i};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import{n as s,k as i,r as m,j as e}from"./index.
|
1
|
+
import{n as s,k as i,r as m,j as e}from"./index.PoIwzrI7.js";import{P as c,R as l}from"./RenderInPortalIfExists.BAkT-LV5.js";const p=""+new URL("../media/flake-0.DgWaVvm5.png",import.meta.url).href,d=""+new URL("../media/flake-1.B2r5AHMK.png",import.meta.url).href,f=""+new URL("../media/flake-2.BnWSExPC.png",import.meta.url).href,o=150,S=150,g=10,E=90,u=4e3,n=(t,a=0)=>Math.random()*(t-a)+a,w=()=>i(`from{transform:translateY(0)
|
2
2
|
rotateX(`,n(360),`deg)
|
3
3
|
rotateY(`,n(360),`deg)
|
4
4
|
rotateZ(`,n(360),"deg);}to{transform:translateY(calc(100vh + ",o,`px))
|
@@ -0,0 +1 @@
|
|
1
|
+
import{n as c,r as s,aE as f,b4 as x,z as b,j as a,b1 as k,b5 as C,C as L,D as v,aC as T}from"./index.PoIwzrI7.js";const h=c("div",{target:"e12r95n60"})(({containerWidth:r})=>({display:"flex",flexDirection:"column",width:r?"100%":"fit-content"})),w=c("a",{target:"e12r95n61"})(({disabled:r,isCurrentPage:o,containerWidth:l,theme:e})=>({textDecoration:"none",width:l?"100%":"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.default,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,backgroundColor:o?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:o?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...r?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}})),S=c("span",{target:"e12r95n62"})(({disabled:r,theme:o})=>({color:o.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...r?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}:{}}));function y(r,o){return r===null&&o?!0:r===null&&!o?!1:r===!0}function P(r){const{onPageChange:o,currentPageScriptHash:l}=s.useContext(f),e=s.useContext(x),{colors:d}=b(),{disabled:t,element:n}=r,i=y(n.useContainerWidth,e),g=l===n.pageScriptHash,p=u=>{n.external?t&&u.preventDefault():(u.preventDefault(),t||o(n.pageScriptHash))};return a("div",{className:"stPageLink","data-testid":"stPageLink",children:a(k,{help:n.help,placement:C.TOP_RIGHT,containerWidth:i,children:a(h,{containerWidth:i,children:L(w,{"data-testid":"stPageLink-NavLink",disabled:t,isCurrentPage:g,containerWidth:i,href:n.page,target:n.external?"_blank":"",rel:"noreferrer",onClick:p,children:[n.icon&&a(v,{size:"lg",color:t?d.fadedText40:d.bodyText,iconValue:n.icon}),a(S,{disabled:t,children:a(T,{source:n.label,allowHTML:!1,isLabel:!0,boldLabel:g,largerLabel:!0,disableLinks:!0})})]})})})})}const B=s.memo(P);export{B as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as l,M as u,j as d,bo as x,c4 as V}from"./index.
|
1
|
+
import{r as l,M as u,j as d,bo as x,c4 as V}from"./index.PoIwzrI7.js";import{a as h}from"./useBasicWidgetState.DzE2MsN8.js";import"./FormClearHelper.Dd0v0IXt.js";const U=(t,o)=>t.getStringValue(o),v=t=>t.options.length===0||u(t.default)?null:t.options[t.default],C=t=>t.rawValue??null,F=(t,o,e,a)=>{o.setStringValue(t,e.value,{fromUi:e.fromUi},a)},M=({disabled:t,element:o,widgetMgr:e,fragmentId:a})=>{const{options:n,help:c,label:i,labelVisibility:r,placeholder:g,acceptNewOptions:p}=o,[f,s]=h({getStateFromWidgetMgr:U,getDefaultStateFromProto:v,getCurrStateFromProto:C,updateWidgetMgrState:F,element:o,widgetMgr:e,fragmentId:a}),m=l.useCallback(b=>{s({value:b,fromUi:!0})},[s]),S=u(o.default)&&!t;return d(V,{label:i,labelVisibility:x(r==null?void 0:r.value),options:n,disabled:t,onChange:m,value:f,help:c,placeholder:g,clearable:S,acceptNewOptions:p})},w=l.memo(M);export{w as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as l,r as o,j as f,l as v}from"./index.
|
1
|
+
import{n as l,r as o,j as f,l as v}from"./index.PoIwzrI7.js";const A=l("div",{target:"ea9qfvi0"})(()=>({lineHeight:0})),g=l("audio",{target:"ea9qfvi1"})(({theme:r})=>({width:"100%",height:r.sizes.minElementHeight,margin:0,padding:0})),T=v.getLogger("Audio");function y({element:r,endpoints:s,elementMgr:u}){const i=o.useRef(null),{startTime:n,endTime:d,loop:a,autoplay:p}=r,E=o.useMemo(()=>{if(!r.id)return!0;const e=u.getElementState(r.id,"preventAutoplay");return e||u.setElementState(r.id,"preventAutoplay",!0),e??!1},[r.id,u]);o.useEffect(()=>{i.current&&(i.current.currentTime=n)},[n]),o.useEffect(()=>{const e=i.current,t=()=>{e&&(e.currentTime=r.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[r]),o.useEffect(()=>{const e=i.current;if(!e)return;let t=!1;const c=()=>{d>0&&e.currentTime>=d&&(a?(e.currentTime=n||0,e.play()):t||(t=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",c),()=>{e&&d>0&&e.removeEventListener("timeupdate",c)}},[d,a,n]),o.useEffect(()=>{const e=i.current;if(!e)return;const t=()=>{a&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[a,n]);const m=s.buildMediaURL(r.url);return f(A,{children:f(g,{className:"stAudio","data-testid":"stAudio",ref:i,controls:!0,autoPlay:p&&!E,src:m,onError:e=>{const t=e.currentTarget.src;T.error(`Client Error: Audio source error - ${t}`),s.sendClientErrorToHost("Audio","Audio source failed to load","onerror triggered",t)}})})}const S=o.memo(y);export{S as default};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{bs as Z,bt as J,r as f,bu as Q,z as Y,bv as s,j as S,C as ee,bo as te,bw as re,bp as ne,b5 as oe,bx as ie,bq as ae,bm as ue,b0 as C,a$ as W,b2 as le}from"./index.
|
1
|
+
import{bs as Z,bt as J,r as f,bu as Q,z as Y,bv as s,j as S,C as ee,bo as te,bw as re,bp as ne,b5 as oe,bx as ie,bq as ae,bm as ue,b0 as C,a$ as W,b2 as le}from"./index.PoIwzrI7.js";import{a as ce}from"./useBasicWidgetState.DzE2MsN8.js";import"./FormClearHelper.Dd0v0IXt.js";var se={secondary:"secondary"},G={default:"default"},fe={default:"default"},k=Object.freeze({radio:"radio",checkbox:"checkbox"}),z=Z("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==G.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});z.displayName="StyledRoot";z.displayName="StyledRoot";function j(e){"@babel/helpers - typeof";return j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(e)}function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},M.apply(this,arguments)}function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function pe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x(Object(r),!0).forEach(function(n){N(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function de(e,t){return he(e)||me(e,t)||be(e,t)||ye()}function ye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function be(e,t){if(e){if(typeof e=="string")return X(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return X(e,t)}}function X(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function me(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,p;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){i=!0,p=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw p}}return n}}function he(e){if(Array.isArray(e))return e}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ve(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Se(e,t,r){return t&&ve(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oe(e,t){if(typeof t!="function"&&t!==null)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&&$(e,t)}function $(e,t){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},$(e,t)}function Ee(e){var t=we();return function(){var n=I(e),o;if(t){var i=I(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return _e(this,o)}}function _e(e,t){if(t&&(j(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return K(e)}function K(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function we(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function I(e){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},I(e)}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Le(e,t){return!Array.isArray(e)&&typeof e!="number"?!1:Array.isArray(e)?e.includes(t):e===t}var F=function(e){Oe(r,e);var t=Ee(r);function r(){var n;ge(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),N(K(n),"childRefs",{}),n}return Se(r,[{key:"render",value:function(){var o=this,i=this.props,a=i.overrides,p=a===void 0?{}:a,c=i.mode,P=c===void 0?k.checkbox:c,d=i.children,y=i.selected,m=i.disabled,l=i.onClick,_=i.kind,h=i.shape,w=i.size,T=J(p.Root,z),O=de(T,2),E=O[0],L=O[1],H=this.props["aria-label"]||this.props.ariaLabel,g=P===k.radio,V=f.Children.count(d);return f.createElement(Q.Consumer,null,function(q){return f.createElement(E,M({"aria-label":H||q.buttongroup.ariaLabel,"data-baseweb":"button-group",role:g?"radiogroup":"group",$shape:h,$length:d.length},L),f.Children.map(d,function(b,R){if(!f.isValidElement(b))return null;var A=b.props.isSelected?b.props.isSelected:Le(y,R);return g&&(o.childRefs[R]=f.createRef()),f.cloneElement(b,{disabled:m||b.props.disabled,isSelected:A,ref:g?o.childRefs[R]:void 0,tabIndex:!g||A||g&&(!y||y===-1)&&R===0?0:-1,onKeyDown:function(u){if(g){var v=Number(y)?Number(y):0;if(u.key==="ArrowUp"||u.key==="ArrowLeft"){u.preventDefault&&u.preventDefault();var B=v-1<0?V-1:v-1;l&&l(u,B),o.childRefs[B].current&&o.childRefs[B].current.focus()}if(u.key==="ArrowDown"||u.key==="ArrowRight"){u.preventDefault&&u.preventDefault();var D=v+1>V-1?0:v+1;l&&l(u,D),o.childRefs[D].current&&o.childRefs[D].current.focus()}}},kind:_,onClick:function(u){m||(b.props.onClick&&b.props.onClick(u),l&&l(u,R))},shape:h,size:w,overrides:pe({BaseButton:{style:function(u){var v=u.$theme;return d.length===1?{}:h!==G.default?{marginLeft:v.sizing.scale100,marginRight:v.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":A,role:g?"radio":"checkbox"}}},b.props.overrides)})}))})}}]),r}(f.Component);N(F,"defaultProps",{disabled:!1,onClick:function(){},shape:G.default,size:fe.default,kind:se.secondary});function Re(e,t){return t.includes(e)?t.filter(r=>r!==e):[...t,e]}function Ce(e,t,r){return e==s.ClickMode.MULTI_SELECT?Re(t,r??[]):r!=null&&r.includes(t)?[]:[t]}function Pe(e){return e.length===0?-1:e[0]}function ke(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function Ie(e,t,r){const n=r===s.Style.PILLS?C.PILLS:r===s.Style.BORDERLESS?C.BORDERLESS_ICON:C.SEGMENTED_CONTROL,o=r===s.Style.BORDERLESS?W.XSMALL:W.MEDIUM,i=n===C.PILLS||n===C.SEGMENTED_CONTROL,a=r===s.Style.BORDERLESS?"lg":"base";return{element:S(le,{icon:t,label:e,iconSize:a,useSmallerFont:i}),kind:n,size:o}}function Te(e,t,r,n){return r.indexOf(n)>-1?!0:t!==s.ClickMode.SINGLE_SELECT||e!==s.SelectionVisualization.ALL_UP_TO_SELECTED?!1:r.length>0&&n<r[0]}function Ae(e,t){return e&&(t=`${t}Active`),t}function Be(e,t){const r={flexWrap:"wrap",maxWidth:"fit-content"};switch(e){case s.Style.BORDERLESS:return{...r,columnGap:t.threeXS,rowGap:t.threeXS};case s.Style.PILLS:return{...r,columnGap:t.twoXS,rowGap:t.twoXS};case s.Style.SEGMENTED_CONTROL:return{...r,columnGap:t.none,rowGap:t.twoXS,"::after":{content:"''",flex:1e4}};default:return r}}function De(e,t,r,n,o,i){const a=Te(r,n,o,t);let p=e.content,c=e.contentIcon;return a&&(p=e.selectedContent?e.selectedContent:p,c=e.selectedContentIcon?e.selectedContentIcon:c),f.forwardRef(function(d,y){const{element:m,kind:l,size:_}=Ie(p??"",c??void 0,i),h=Ae(!!(a&&!e.selectedContent&&!e.selectedContentIcon),l);return S(ue,{...d,size:_,kind:h,children:m})})}function je(e,t){return e.getIntArrayValue(t)}function Me(e){return e.default??null}function $e(e){return e.value??null}function Ge(e){const{disabled:t,element:r,fragmentId:n,widgetMgr:o}=e,{clickMode:i,options:a,selectionVisualization:p,style:c,label:P,labelVisibility:d,help:y}=r,m=Y(),[l,_]=ce({getStateFromWidgetMgr:je,getDefaultStateFromProto:Me,getCurrStateFromProto:$e,updateWidgetMgrState:ke,element:r,widgetMgr:o,fragmentId:n}),h=(O,E)=>{const L=Ce(i,E,l);_({value:L,fromUi:!0})};let w;i===s.ClickMode.SINGLE_SELECT?w=k.radio:i===s.ClickMode.MULTI_SELECT&&(w=k.checkbox);const T=f.useMemo(()=>a.map((O,E)=>{const L=De(O,E,p,i,l,c);return S(L,{},`${O.content}-${E}`)}),[i,a,p,c,l]);return ee("div",{className:"stButtonGroup","data-testid":"stButtonGroup",children:[S(ae,{label:P,disabled:t,labelVisibility:te((d==null?void 0:d.value)??ie.LabelVisibilityOptions.COLLAPSED),children:y&&S(re,{children:S(ne,{content:y,placement:oe.TOP})})}),S(F,{disabled:t,mode:w,onClick:h,selected:i===s.ClickMode.MULTI_SELECT?l:Pe(l),overrides:{Root:{style:f.useCallback(()=>Be(c,m.spacing),[c,m.spacing])}},children:T})]})}const Ue=f.memo(Ge);export{Ue as default};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var jU=Object.defineProperty;var $U=(r,e,t)=>e in r?jU(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var V=(r,e,t)=>$U(r,typeof e!="symbol"?e+"":e,t);import{r as Bt,at as yr,aT as dt,g as ih,aU as Tu,_ as NO,n as kO,B as UO,aD as zO,U as Q1,aV as lB,aA as WU,j as Df,F as JU,aE as XU,z as KU,C as uB,aW as YU,aX as fB}from"./index.
|
1
|
+
var jU=Object.defineProperty;var $U=(r,e,t)=>e in r?jU(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var V=(r,e,t)=>$U(r,typeof e!="symbol"?e+"":e,t);import{r as Bt,at as yr,aT as dt,g as ih,aU as Tu,_ as NO,n as kO,B as UO,aD as zO,U as Q1,aV as lB,aA as WU,j as Df,F as JU,aE as XU,z as KU,C as uB,aW as YU,aX as fB}from"./index.PoIwzrI7.js";import{_ as ls,a as qU,C as ZU}from"./toConsumableArray.6GvveewD.js";import{a as Wu,b as Ju,_ as qx,c as dA,d as Zx}from"./possibleConstructorReturn.ZgHiGHSO.js";import{a as QU,T as e5}from"./Toolbar.CNzefYiX.js";import{E as GO,w as t5}from"./withFullScreenWrapper.Bh08pTH8.js";import{u as r5}from"./useBasicWidgetState.DzE2MsN8.js";import{u as n5,s as i5}from"./threshold.DjX0wlsa.js";import"./FormClearHelper.Dd0v0IXt.js";import"./value.CgPGBV_l.js";function s5(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in r)){const o=Object.getOwnPropertyDescriptor(n,i);o&&Object.defineProperty(r,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}const yu={};function Hm(r,e){if(!r)throw new Error(e||"loader assertion failed.")}const Qx=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),hB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);hB&&parseFloat(hB[1]);const Pu=globalThis,Ea=globalThis.process||{},o5=globalThis.navigator||{};function VO(r){var n,i;if(typeof window<"u"&&((n=window.process)==null?void 0:n.type)==="renderer"||typeof process<"u"&&((i=process.versions)!=null&&i.electron))return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function rl(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||VO()}function a5(r){return rl()?VO()?"Electron":(o5.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const iy="4.1.0";function c5(r){try{const e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}let l5=class{constructor(e,t,n="sessionStorage"){this.storage=c5(n),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function u5(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function f5(r,e=8){const t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var jm;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(jm||(jm={}));const h5=10;function dB(r){return typeof r!="string"?r:(r=r.toUpperCase(),jm[r]||jm.WHITE)}function d5(r,e,t){return!rl&&typeof r=="string"&&(e&&(r=`\x1B[${dB(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${dB(t)+h5}m${r}\x1B[49m`)),r}function A5(r,e=["constructor"]){const t=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(t),i=r;for(const o of n){const s=i[o];typeof s=="function"&&(e.find(c=>o===c)||(i[o]=s.bind(r)))}}function ew(r,e){if(!r)throw new Error("Assertion failed")}function id(){var e,t,n;let r;if(rl()&&Pu.performance)r=(t=(e=Pu==null?void 0:Pu.performance)==null?void 0:e.now)==null?void 0:t.call(e);else if("hrtime"in Ea){const i=(n=Ea==null?void 0:Ea.hrtime)==null?void 0:n.call(Ea);r=i[0]*1e3+i[1]/1e6}else r=Date.now();return r}const sd={debug:rl()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},p5={enabled:!0,level:0};function od(){}const AB={},pB={once:!0};let HO=class{constructor({id:e}={id:""}){this.VERSION=iy,this._startTs=id(),this._deltaTs=id(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new l5(`__probe-${this.id}__`,p5),this.timeStamp(`${this.id} started`),A5(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((id()-this._startTs).toPrecision(10))}getDelta(){return Number((id()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,sd.warn,arguments,pB)}error(e){return this._getLogFunction(0,e,sd.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,sd.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,sd.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,sd.debug||sd.info,arguments,pB)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||od,n&&[n],{tag:m5(t)}):od}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||od)}group(e,t,n={collapsed:!1}){const i=gB({logLevel:e,message:t,opts:n}),{collapsed:o}=n;return i.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,t,n={}){return this.group(e,t,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||od)}withGroup(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=jO(e)}_getLogFunction(e,t,n,i,o){if(this._shouldLog(e)){o=gB({logLevel:e,message:t,args:i,opts:o}),n=n||o.method,ew(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=id();const s=o.tag||o.message;if(o.once&&s)if(!AB[s])AB[s]=id();else return od;return t=g5(this.id,o.message,o),n.bind(console,t,...o.args)}return od}};HO.VERSION=iy;function jO(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return ew(Number.isFinite(e)&&e>=0),e}function gB(r){const{logLevel:e,message:t}=r;r.logLevel=jO(e);const n=r.args?Array.from(r.args):[];for(;n.length&&n.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&n.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break}typeof r.message=="function"&&(r.message=r.message());const i=typeof r.message;return ew(i==="string"||i==="object"),Object.assign(r,{args:n},r.opts)}function g5(r,e,t){if(typeof e=="string"){const n=t.time?f5(u5(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=d5(e,t.color,t.background)}return e}function m5(r){for(const e in r)for(const t in r[e])return t||"untitled";return"empty"}function _5(r,e){return $O(r||{},e)}function $O(r,e,t=0){if(t>3)return e;const n={...r};for(const[i,o]of Object.entries(e))o&&typeof o=="object"&&!Array.isArray(o)?n[i]=$O(n[i]||{},e[i],t+1):n[i]=e[i];return n}const y5="latest";function v5(){var r;return(r=globalThis._loadersgl_)!=null&&r.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version}const b5=v5();function ku(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}const $f=typeof process!="object"||String(process)!=="[object process]"||process.browser,x5=typeof window<"u"&&typeof window.orientation<"u",mB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);mB&&parseFloat(mB[1]);let w5=class{constructor(e,t){V(this,"name");V(this,"workerThread");V(this,"isRunning",!0);V(this,"result");V(this,"_resolve",()=>{});V(this,"_reject",()=>{});this.name=e,this.workerThread=t,this.result=new Promise((n,i)=>{this._resolve=n,this._reject=i})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){ku(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){ku(this.isRunning),this.isRunning=!1,this._reject(e)}},Lv=class{terminate(){}};const Nv=new Map;function C5(r){ku(r.source&&!r.url||!r.source&&r.url);let e=Nv.get(r.source||r.url);return e||(r.url&&(e=E5(r.url),Nv.set(r.url,e)),r.source&&(e=WO(r.source),Nv.set(r.source,e))),ku(e),e}function E5(r){if(!r.startsWith("http"))return r;const e=T5(r);return WO(e)}function WO(r){const e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function T5(r){return`try {
|
2
2
|
importScripts('${r}');
|
3
3
|
} catch (error) {
|
4
4
|
console.error(error);
|
@@ -5363,4 +5363,4 @@ fragColor.g = outTexture.r / max(1.0, outTexture.a);
|
|
5363
5363
|
float textureSize;
|
5364
5364
|
} maxWeight;
|
5365
5365
|
`,uniformTypes:{textureSize:"f32"}},xEe=2,K1={format:"rgba8unorm",mipmaps:!1,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}},CO=[0,0],wEe={SUM:0,MEAN:1},CEe={getPosition:{type:"accessor",value:r=>r.position},getWeight:{type:"accessor",value:1},intensity:{type:"number",min:0,value:1},radiusPixels:{type:"number",min:1,max:100,value:50},colorRange:tv,threshold:{type:"number",min:0,max:1,value:.05},colorDomain:{type:"array",value:null,optional:!0},aggregation:"SUM",weightsTextureSize:{type:"number",min:128,max:2048,value:2048},debounceTimeout:{type:"number",min:0,max:1e3,value:500}},EEe=["float32-renderable-webgl","texture-blend-float-webgl"],TEe={data:{props:["radiusPixels"]}};class UE extends a9{getShaders(e){let t=[Ss];return e.modules&&(t=[...t,...e.modules]),super.getShaders({...e,modules:t})}initializeState(){super.initializeAggregationLayer(TEe),this.setState({colorDomain:CO}),this._setupTextureParams(),this._setupAttributes(),this._setupResources()}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState(e){super.updateState(e),this._updateHeatmapState(e)}_updateHeatmapState(e){const{props:t,oldProps:n}=e,i=this._getChangeFlags(e);(i.dataChanged||i.viewportChanged)&&(i.boundsChanged=this._updateBounds(i.dataChanged),this._updateTextureRenderingBounds()),i.dataChanged||i.boundsChanged?(clearTimeout(this.state.updateTimer),this.setState({isWeightMapDirty:!0})):i.viewportZoomChanged&&this._debouncedUpdateWeightmap(),t.colorRange!==n.colorRange&&this._updateColorTexture(e),this.state.isWeightMapDirty&&this._updateWeightmap(),this.setState({zoom:e.context.viewport.zoom})}renderLayers(){const{weightsTexture:e,triPositionBuffer:t,triTexCoordBuffer:n,maxWeightsTexture:i,colorTexture:o,colorDomain:s}=this.state,{updateTriggers:c,intensity:f,threshold:_,aggregation:b}=this.props,T=this.getSubLayerClass("triangle",o9);return new T(this.getSubLayerProps({id:"triangle-layer",updateTriggers:c}),{coordinateSystem:Jr.DEFAULT,data:{attributes:{positions:t,texCoords:n}},vertexCount:4,maxTexture:i,colorTexture:o,aggregationMode:wEe[b]||0,weightsTexture:e,intensity:f,threshold:_,colorDomain:s})}finalizeState(e){super.finalizeState(e);const{weightsTransform:t,weightsTexture:n,maxWeightTransform:i,maxWeightsTexture:o,triPositionBuffer:s,triTexCoordBuffer:c,colorTexture:f,updateTimer:_}=this.state;t==null||t.destroy(),n==null||n.destroy(),i==null||i.destroy(),o==null||o.destroy(),s==null||s.destroy(),c==null||c.destroy(),f==null||f.destroy(),_&&clearTimeout(_)}_getAttributeManager(){return new dy(this.context.device,{id:this.props.id,stats:this.context.stats})}_getChangeFlags(e){const t={},{dimensions:n}=this.state;t.dataChanged=this.isAttributeChanged()&&"attribute changed"||this.isAggregationDirty(e,{compareAll:!0,dimension:n.data})&&"aggregation is dirty",t.viewportChanged=e.changeFlags.viewportChanged;const{zoom:i}=this.state;return(!e.context.viewport||e.context.viewport.zoom!==i)&&(t.viewportZoomChanged=!0),t}_createTextures(){const{textureSize:e,format:t}=this.state;this.setState({weightsTexture:this.context.device.createTexture({...K1,width:e,height:e,format:t}),maxWeightsTexture:this.context.device.createTexture({...K1,width:1,height:1,format:t})})}_setupAttributes(){this.getAttributeManager().add({positions:{size:3,type:"float64",accessor:"getPosition"},weights:{size:1,accessor:"getWeight"}}),this.setState({positionAttributeName:"positions"})}_setupTextureParams(){const{device:e}=this.context,{weightsTextureSize:t}=this.props,n=Math.min(t,e.limits.maxTextureDimension2D),i=EEe.every(c=>e.features.has(c)),o=i?"rgba32float":"rgba8unorm",s=i?1:1/255;this.setState({textureSize:n,format:o,weightsScale:s}),i||$r.warn(`HeatmapLayer: ${this.id} rendering to float texture not supported, falling back to low precision format`)()}_createWeightsTransform(e){let{weightsTransform:t}=this.state;const{weightsTexture:n}=this.state,i=this.getAttributeManager();t==null||t.destroy(),t=new YS(this.context.device,{id:`${this.id}-weights-transform`,bufferLayout:i.getBufferLayouts(),vertexCount:1,targetTexture:n,parameters:{depthWriteEnabled:!1,blendColorOperation:"add",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"},topology:"point-list",...e,modules:[...e.modules,vEe]}),this.setState({weightsTransform:t})}_setupResources(){this._createTextures();const{device:e}=this.context,{textureSize:t,weightsTexture:n,maxWeightsTexture:i}=this.state,o=this.getShaders({vs:xO,fs:wO});this._createWeightsTransform(o);const s=this.getShaders({vs:mEe,fs:_Ee,modules:[bEe]}),c=new YS(e,{id:`${this.id}-max-weights-transform`,targetTexture:i,...s,vertexCount:t*t,topology:"point-list",parameters:{depthWriteEnabled:!1,blendColorOperation:"max",blendAlphaOperation:"max",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"}}),f={inTexture:n,textureSize:t};c.model.shaderInputs.setProps({maxWeight:f}),this.setState({weightsTexture:n,maxWeightsTexture:i,maxWeightTransform:c,zoom:null,triPositionBuffer:e.createBuffer({byteLength:48}),triTexCoordBuffer:e.createBuffer({byteLength:48})})}updateShaders(e){this._createWeightsTransform({vs:xO,fs:wO,...e})}_updateMaxWeightValue(){const{maxWeightTransform:e}=this.state;e.run({parameters:{viewport:[0,0,1,1]},clearColor:[0,0,0,0]})}_updateBounds(e=!1){const{viewport:t}=this.context,n=[t.unproject([0,0]),t.unproject([t.width,0]),t.unproject([0,t.height]),t.unproject([t.width,t.height])].map(c=>c.map(Math.fround)),i=cEe(n),o={visibleWorldBounds:i,viewportCorners:n};let s=!1;if(e||!this.state.worldBounds||!lEe(this.state.worldBounds,i)){const c=this._worldToCommonBounds(i),f=this._commonToWorldBounds(c);this.props.coordinateSystem===Jr.LNGLAT&&(f[1]=Math.max(f[1],-85.051129),f[3]=Math.min(f[3],85.051129),f[0]=Math.max(f[0],-360),f[2]=Math.min(f[2],360));const _=this._worldToCommonBounds(f);o.worldBounds=f,o.normalizedCommonBounds=_,s=!0}return this.setState(o),s}_updateTextureRenderingBounds(){const{triPositionBuffer:e,triTexCoordBuffer:t,normalizedCommonBounds:n,viewportCorners:i}=this.state,{viewport:o}=this.context;e.write(vO(i,3));const s=i.map(c=>fEe(o.projectPosition(c),n));t.write(vO(s,2))}_updateColorTexture(e){const{colorRange:t}=e.props;let{colorTexture:n}=this.state;const i=t9(t,!1,Uint8Array);n&&(n==null?void 0:n.width)===t.length?n.setTexture2DData({data:i}):(n==null||n.destroy(),n=this.context.device.createTexture({...K1,data:i,width:t.length,height:1})),this.setState({colorTexture:n})}_updateWeightmap(){const{radiusPixels:e,colorDomain:t,aggregation:n}=this.props,{worldBounds:i,textureSize:o,weightsScale:s,weightsTexture:c}=this.state,f=this.state.weightsTransform;this.state.isWeightMapDirty=!1;const _=this._worldToCommonBounds(i,{useLayerCoordinateSystem:!0});if(t&&n==="SUM"){const{viewport:K}=this.context,fe=K.distanceScales.metersPerUnit[2]*(_[2]-_[0])/o;this.state.colorDomain=t.map(Z=>Z*fe*s)}else this.state.colorDomain=t||CO;const T=this.getAttributeManager().getAttributes(),S=this.getModuleSettings();this._setModelAttributes(f.model,T),f.model.setVertexCount(this.getNumInstances());const D={radiusPixels:e,commonBounds:_,textureWidth:o,weightsScale:s,weightsTexture:c},{viewport:k,devicePixelRatio:G,coordinateSystem:W,coordinateOrigin:z}=S,{modelMatrix:j}=this.props;f.model.shaderInputs.setProps({project:{viewport:k,devicePixelRatio:G,modelMatrix:j,coordinateSystem:W,coordinateOrigin:z},weight:D}),f.run({parameters:{viewport:[0,0,o,o]},clearColor:[0,0,0,0]}),this._updateMaxWeightValue()}_debouncedUpdateWeightmap(e=!1){let{updateTimer:t}=this.state;const{debounceTimeout:n}=this.props;e?(t=null,this._updateBounds(!0),this._updateTextureRenderingBounds(),this.setState({isWeightMapDirty:!0})):(this.setState({isWeightMapDirty:!1}),clearTimeout(t),t=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),n)),this.setState({updateTimer:t})}_worldToCommonBounds(e,t={}){const{useLayerCoordinateSystem:n=!1}=t,[i,o,s,c]=e,{viewport:f}=this.context,{textureSize:_}=this.state,{coordinateSystem:b}=this.props,T=n&&(b===Jr.LNGLAT_OFFSETS||b===Jr.METER_OFFSETS),S=T?f.projectPosition(this.props.coordinateOrigin):[0,0],D=_*xEe/f.scale;let k,G;return n&&!T?(k=this.projectPosition([i,o,0]),G=this.projectPosition([s,c,0])):(k=f.projectPosition([i,o,0]),G=f.projectPosition([s,c,0])),uEe([k[0]-S[0],k[1]-S[1],G[0]-S[0],G[1]-S[1]],D,D)}_commonToWorldBounds(e){const[t,n,i,o]=e,{viewport:s}=this.context,c=s.unprojectPosition([t,n]),f=s.unprojectPosition([i,o]);return c.slice(0,2).concat(f.slice(0,2))}}UE.layerName="HeatmapLayer";UE.defaultProps=CEe;const BEe=Object.freeze(Object.defineProperty({__proto__:null,CPUAggregator:kA,ContourLayer:NE,GridLayer:kE,HeatmapLayer:UE,HexagonLayer:LE,ScreenGridLayer:OE,WebGLAggregator:Pa,_AggregationLayer:UA},Symbol.toStringTag,{value:"Module"})),SEe={ClusterTileLayer:yE,H3TileLayer:vE,HeatmapTileLayer:xE,PointLabelLayer:ev,QuadbinTileLayer:Qy,RasterTileLayer:EE,VectorTileLayer:BE};function Xx(r,e=""){if(!r)throw new Error(`JSON conversion error ${e}`)}function IEe(r,e){const t=PEe(e);let n=r;for(const i of t)n=MEe(n)?n[i]:void 0;return n}function MEe(r){return r!==null&&typeof r=="object"}const EO={};function PEe(r){if(typeof r=="string"){let e=EO[r];return e||(e=r.split("."),EO[r]=e),e}return Array.isArray(r)?r:[r]}var bm={exports:{}},TO;function REe(){return TO||(TO=1,function(r,e){(function(t){var n="Compound",i="Identifier",o="MemberExpression",s="Literal",c="ThisExpression",f="CallExpression",_="UnaryExpression",b="BinaryExpression",T="LogicalExpression",S="ConditionalExpression",D="ArrayExpression",k=46,G=44,W=39,z=34,j=40,K=41,fe=91,Z=93,ae=63,Be=59,Ne=58,de=function(Tt,tt){var lr=new Error(Tt+" at character "+tt);throw lr.index=tt,lr.description=Tt,lr},_e=!0,pe={"-":_e,"!":_e,"~":_e,"+":_e},J={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},te=function(Tt){var tt=0,lr;for(var Jt in Tt)(lr=Jt.length)>tt&&Tt.hasOwnProperty(Jt)&&(tt=lr);return tt},be=te(pe),Qe=te(J),Ee={true:!0,false:!1,null:null},De="this",Ge=function(Tt){return J[Tt]||0},et=function(Tt,tt,lr){var Jt=Tt==="||"||Tt==="&&"?T:b;return{type:Jt,operator:Tt,left:tt,right:lr}},it=function(Tt){return Tt>=48&&Tt<=57},rt=function(Tt){return Tt===36||Tt===95||Tt>=65&&Tt<=90||Tt>=97&&Tt<=122||Tt>=128&&!J[String.fromCharCode(Tt)]},ct=function(Tt){return Tt===36||Tt===95||Tt>=65&&Tt<=90||Tt>=97&&Tt<=122||Tt>=48&&Tt<=57||Tt>=128&&!J[String.fromCharCode(Tt)]},mt=function(Tt){for(var tt=0,lr=Tt.charAt,Jt=Tt.charCodeAt,Wt=function(Ut){return lr.call(Tt,Ut)},Lt=function(Ut){return Jt.call(Tt,Ut)},sr=Tt.length,qr=function(){for(var Ut=Lt(tt);Ut===32||Ut===9||Ut===10||Ut===13;)Ut=Lt(++tt)},Er=function(){var Ut=Mn(),Ar,Tr;if(qr(),Lt(tt)===ae){if(tt++,Ar=Er(),Ar||de("Expected expression",tt),qr(),Lt(tt)===Ne)return tt++,Tr=Er(),Tr||de("Expected expression",tt),{type:S,test:Ut,consequent:Ar,alternate:Tr};de("Expected :",tt)}else return Ut},pr=function(){qr();for(var Ut=Tt.substr(tt,Qe),Ar=Ut.length;Ar>0;){if(J.hasOwnProperty(Ut)&&(!rt(Lt(tt))||tt+Ut.length<Tt.length&&!ct(Lt(tt+Ut.length))))return tt+=Ar,Ut;Ut=Ut.substr(0,--Ar)}return!1},Mn=function(){var Ut,Ar,Tr,Qr,ui,Pe,Dt,Vt,or;if(Pe=hr(),Ar=pr(),!Ar)return Pe;for(ui={value:Ar,prec:Ge(Ar)},Dt=hr(),Dt||de("Expected expression after "+Ar,tt),Qr=[Pe,ui,Dt];(Ar=pr())&&(Tr=Ge(Ar),Tr!==0);){for(ui={value:Ar,prec:Tr},or=Ar;Qr.length>2&&Tr<=Qr[Qr.length-2].prec;)Dt=Qr.pop(),Ar=Qr.pop().value,Pe=Qr.pop(),Ut=et(Ar,Pe,Dt),Qr.push(Ut);Ut=hr(),Ut||de("Expected expression after "+or,tt),Qr.push(ui,Ut)}for(Vt=Qr.length-1,Ut=Qr[Vt];Vt>1;)Ut=et(Qr[Vt-1].value,Qr[Vt-2],Ut),Vt-=2;return Ut},hr=function(){var Ut,Ar,Tr;if(qr(),Ut=Lt(tt),it(Ut)||Ut===k)return dr();if(Ut===W||Ut===z)return Zr();if(Ut===fe)return Xn();for(Ar=Tt.substr(tt,be),Tr=Ar.length;Tr>0;){if(pe.hasOwnProperty(Ar)&&(!rt(Lt(tt))||tt+Ar.length<Tt.length&&!ct(Lt(tt+Ar.length))))return tt+=Tr,{type:_,operator:Ar,argument:hr(),prefix:!0};Ar=Ar.substr(0,--Tr)}return rt(Ut)||Ut===j?$n():!1},dr=function(){for(var Ut="",Ar,Tr;it(Lt(tt));)Ut+=Wt(tt++);if(Lt(tt)===k)for(Ut+=Wt(tt++);it(Lt(tt));)Ut+=Wt(tt++);if(Ar=Wt(tt),Ar==="e"||Ar==="E"){for(Ut+=Wt(tt++),Ar=Wt(tt),(Ar==="+"||Ar==="-")&&(Ut+=Wt(tt++));it(Lt(tt));)Ut+=Wt(tt++);it(Lt(tt-1))||de("Expected exponent ("+Ut+Wt(tt)+")",tt)}return Tr=Lt(tt),rt(Tr)?de("Variable names cannot start with a number ("+Ut+Wt(tt)+")",tt):Tr===k&&de("Unexpected period",tt),{type:s,value:parseFloat(Ut),raw:Ut}},Zr=function(){for(var Ut="",Ar=Wt(tt++),Tr=!1,Qr;tt<sr;)if(Qr=Wt(tt++),Qr===Ar){Tr=!0;break}else if(Qr==="\\")switch(Qr=Wt(tt++),Qr){case"n":Ut+=`
|
5366
|
-
`;break;case"r":Ut+="\r";break;case"t":Ut+=" ";break;case"b":Ut+="\b";break;case"f":Ut+="\f";break;case"v":Ut+="\v";break;default:Ut+=Qr}else Ut+=Qr;return Tr||de('Unclosed quote after "'+Ut+'"',tt),{type:s,value:Ut,raw:Ar+Ut+Ar}},Sr=function(){var Ut=Lt(tt),Ar=tt,Tr;for(rt(Ut)?tt++:de("Unexpected "+Wt(tt),tt);tt<sr&&(Ut=Lt(tt),ct(Ut));)tt++;return Tr=Tt.slice(Ar,tt),Ee.hasOwnProperty(Tr)?{type:s,value:Ee[Tr],raw:Tr}:Tr===De?{type:c}:{type:i,name:Tr}},ei=function(Ut){for(var Ar,Tr=[],Qr,ui=!1,Pe=0;tt<sr;)if(qr(),Ar=Lt(tt),Ar===Ut){ui=!0,tt++,Ut===K&&Pe&&Pe>=Tr.length&&de("Unexpected token "+String.fromCharCode(Ut),tt);break}else if(Ar===G){if(tt++,Pe++,Pe!==Tr.length){if(Ut===K)de("Unexpected token ,",tt);else if(Ut===Z)for(var Dt=Tr.length;Dt<Pe;Dt++)Tr.push(null)}}else Qr=Er(),(!Qr||Qr.type===n)&&de("Expected comma",tt),Tr.push(Qr);return ui||de("Expected "+String.fromCharCode(Ut),tt),Tr},$n=function(){var Ut,Ar;for(Ut=Lt(tt),Ut===j?Ar=un():Ar=Sr(),qr(),Ut=Lt(tt);Ut===k||Ut===fe||Ut===j;)tt++,Ut===k?(qr(),Ar={type:o,computed:!1,object:Ar,property:Sr()}):Ut===fe?(Ar={type:o,computed:!0,object:Ar,property:Er()},qr(),Ut=Lt(tt),Ut!==Z&&de("Unclosed [",tt),tt++):Ut===j&&(Ar={type:f,arguments:ei(K),callee:Ar}),qr(),Ut=Lt(tt);return Ar},un=function(){tt++;var Ut=Er();if(qr(),Lt(tt)===K)return tt++,Ut;de("Unclosed (",tt)},Xn=function(){return tt++,{type:D,elements:ei(Z)}},kn=[],bn,Wn;tt<sr;)bn=Lt(tt),bn===Be||bn===G?tt++:(Wn=Er())?kn.push(Wn):tt<sr&&de('Unexpected "'+Wt(tt)+'"',tt);return kn.length===1?kn[0]:{type:n,body:kn}};mt.version="0.3.5",mt.toString=function(){return"JavaScript Expression Parser (JSEP) v"+mt.version},mt.addUnaryOp=function(Tt){return be=Math.max(Tt.length,be),pe[Tt]=_e,this},mt.addBinaryOp=function(Tt,tt){return Qe=Math.max(Tt.length,Qe),J[Tt]=tt,this},mt.addLiteral=function(Tt,tt){return Ee[Tt]=tt,this},mt.removeUnaryOp=function(Tt){return delete pe[Tt],Tt.length===be&&(be=te(pe)),this},mt.removeAllUnaryOps=function(){return pe={},be=0,this},mt.removeBinaryOp=function(Tt){return delete J[Tt],Tt.length===Qe&&(Qe=te(J)),this},mt.removeAllBinaryOps=function(){return J={},Qe=0,this},mt.removeLiteral=function(Tt){return delete Ee[Tt],this},mt.removeAllLiterals=function(){return Ee={},this},r.exports?e=r.exports=mt:e.parse=mt})()}(bm,bm.exports)),bm.exports}var FEe=REe();const OEe=ih(FEe),BO={"||":(r,e)=>r||e,"&&":(r,e)=>r&&e,"|":(r,e)=>r|e,"^":(r,e)=>r^e,"&":(r,e)=>r&e,"==":(r,e)=>r==e,"!=":(r,e)=>r!=e,"===":(r,e)=>r===e,"!==":(r,e)=>r!==e,"<":(r,e)=>r<e,">":(r,e)=>r>e,"<=":(r,e)=>r<=e,">=":(r,e)=>r>=e,"<<":(r,e)=>r<<e,">>":(r,e)=>r>>e,">>>":(r,e)=>r>>>e,"+":(r,e)=>r+e,"-":(r,e)=>r-e,"*":(r,e)=>r*e,"/":(r,e)=>r/e,"%":(r,e)=>r%e},DEe={"-":r=>-r,"+":r=>+r,"~":r=>~r,"!":r=>!r};function SO(r,e){return r.map(function(t){return Vs(t,e)})}function IO(r,e){const t=Vs(r.object,e);let n;if(r.computed?n=Vs(r.property,e):n=r.property.name,/^__proto__|prototype|constructor$/.test(n))throw Error(`Access to member "${n}" disallowed.`);return[t,t[n]]}function Vs(r,e){const t=r;switch(t.type){case"ArrayExpression":return SO(t.elements,e);case"BinaryExpression":return BO[t.operator](Vs(t.left,e),Vs(t.right,e));case"CallExpression":let n,i,o;return t.callee.type==="MemberExpression"?(o=IO(t.callee,e),n=o[0],i=o[1]):i=Vs(t.callee,e),typeof i!="function"?void 0:i.apply(n,SO(t.arguments,e));case"ConditionalExpression":return Vs(t.test,e)?Vs(t.consequent,e):Vs(t.alternate,e);case"Identifier":return e[t.name];case"Literal":return t.value;case"LogicalExpression":return t.operator==="||"?Vs(t.left,e)||Vs(t.right,e):t.operator==="&&"?Vs(t.left,e)&&Vs(t.right,e):BO[t.operator](Vs(t.left,e),Vs(t.right,e));case"MemberExpression":return IO(t,e)[1];case"ThisExpression":return e;case"UnaryExpression":return DEe[t.operator](Vs(t.argument,e));default:return}}const Y1={"-":r=>r};function c9(r,e){if(r in Y1)return Y1[r];let t;const n=OEe(r);return n.type==="Identifier"?t=i=>IEe(i,r):(Kx(n,i=>{if(i.type==="CallExpression")throw new Error("Function calls not allowed in JSON expressions")}),t=i=>Vs(n,i)),Y1[r]=t,t}function Kx(r,e){if(Array.isArray(r))r.forEach(t=>Kx(t,e));else if(r&&typeof r=="object"){r.type&&e(r);for(const t in r)Kx(r[t],e)}}const V_="@@=",MO="@@#",LEe="@@type",l9="@@function",PO=r=>r&&typeof r=="object";class Yx{constructor(...e){this.typeKey=LEe,this.functionKey=l9,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=c9,this.preProcessClassProps=(t,n)=>n,this.postProcessConvertedJson=t=>t;for(const t of e)this.merge(t)}merge(e){for(const t in e)switch(t){case"layers":case"views":Object.assign(this.classes,e[t]);break;default:if(t in this){const n=e[t];this[t]=PO(this[t])?Object.assign(this[t],n):n}}}validate(e){return Xx(!this.typeKey||typeof this.typeKey=="string"),Xx(PO(this.classes)),!0}}function NEe(r){return typeof r=="string"&&r.startsWith(V_)}function kEe(r){return r.replace(V_,"")}function u9(r,e){const t={};for(const n in r){let i=r[n];NEe(i)&&(i=kEe(i),i=c9(i)),t[n]=i}return t}function UEe(r,e,t){const n=t.classes[r],i=t.reactComponents[r];if(!n&&!i){const{log:o}=t;if(o){const s=JSON.stringify(e,null,0).slice(0,40);o.warn(`JSON converter: No registered class of type ${r}(${s}...) `)}return null}return n?zEe(n,e,t):GEe(i,e,t)}function zEe(r,e,t){return t.preProcessClassProps&&(e=t.preProcessClassProps(r,e,t)),e=u9(e),new r(e)}function GEe(r,e,t){const{React:n}=t,{children:i=[]}=e;return delete e.children,t.preProcessClassProps&&(e=t.preProcessClassProps(r,e,t)),e=u9(e),n.createElement(r,e,i)}function VEe(r,e,t){const n=t.functions[r];if(!n){const{log:i}=t;if(i){const o=JSON.stringify(e,null,0).slice(0,40);i.warn(`JSON converter: No registered function ${r}(${o}...) `)}return null}return n(e)}function HEe(r){return typeof r=="string"?JSON.parse(r):r}const zE=r=>r&&typeof r=="object";class jEe{constructor(e){this.log=console,this.onJSONChange=()=>{},this.json=null,this.convertedJson=null,this.setProps(e)}finalize(){}setProps(e){"configuration"in e&&(this.configuration=e.configuration instanceof Yx?e.configuration:new Yx(e.configuration)),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}mergeConfiguration(e){this.configuration.merge(e)}convert(e){if(!e||e===this.json)return this.convertedJson;this.json=e;const t=HEe(e);let n=$Ee(t,this.configuration);return n=this.configuration.postProcessConvertedJson(n),this.convertedJson=n,n}convertJson(e){return this.convert(e)}}function $Ee(r,e){return e=new Yx(e),GE(r,"",e)}function GE(r,e,t){return Array.isArray(r)?r.map((n,i)=>GE(n,String(i),t)):WEe(r,t)?JEe(r,t):zE(r)?l9 in r?XEe(r,t):VE(r,t):typeof r=="string"?KEe(r,e,t):r}function WEe(r,e){const{typeKey:t}=e;return zE(r)&&!!r[t]}function JEe(r,e){const{typeKey:t}=e,n=r[t];let i={...r};return delete i[t],i=VE(i,e),UEe(n,i,e)}function XEe(r,e){const{functionKey:t}=e,n=r[t];let i={...r};return delete i[t],i=VE(i,e),VEe(n,i,e)}function VE(r,e){Xx(zE(r));const t={};for(const n in r){const i=r[n];t[n]=GE(i,n,e)}return t}function KEe(r,e,t){if(r.startsWith(V_)&&t.convertFunction)return r=r.replace(V_,""),t.convertFunction(r,t);if(r.startsWith(MO)){if(r=r.replace(MO,""),t.constants[r])return t.constants[r];const[n,i]=r.split(".");return t.enumerations[n][i]}return r}const YEe={classes:{..._ue,...BEe,...d2e,...ame,...SEe},functions:{colorBins:Zwe,colorCategories:Qwe,colorContinuous:eCe}},f9=new jEe({configuration:YEe}),qEe={[Xy.layerName]:["getFillColor"],[Ny.layerName]:["getFillColor"],[sl.layerName]:["getFillColor"],[DA.layerName]:["getFillColor"],[Py.layerName]:["getFillColor"],[My.layerName]:["getFillColor"],[Oy.layerName]:["getColor"],[Mg.layerName]:["getTargetColor","getSourceColor"],[il.layerName]:["getFillColor"],[jl.layerName]:["getFillColor"],[OA.layerName]:["getColor"],[Ty.layerName]:["getColor"],[Yu.layerName]:["getColor"],[Pg.layerName]:["getColor"],[Zu.layerName]:["getFillColor"],[Rg.layerName]:["getFillColor","getColor","getLineColor"],[qu.layerName]:["getFillColor"],[dh.layerName]:["getColor"],[Ug.layerName]:["getColor"],[th.layerName]:["getColor"]},ZEe=({object:r,objectInfo:e,originalFillFunction:t})=>{const n=typeof t=="function"?t(r,e):t;if(Array.isArray(n))return[n[0]||0,n[1]||0,n[2]||0,n[3]||255];if(typeof n=="string"&&n.startsWith("@@=")){const i=f9.convert({originalColor:n}).originalColor(r);return[i[0]||0,i[1]||0,i[2]||0,i[3]||255]}return null},RO=({isSelected:r,object:e,objectInfo:t,opacity:n,originalFillFunction:i})=>{const o=ZEe({object:e,objectInfo:t,originalFillFunction:i});if(!o)return null;let s=0;return r?s=Math.max(typeof o[3]=="number"?o[3]:n,n):s=Math.min(typeof o[3]=="number"?o[3]:n,n),[o[0]||0,o[1]||0,o[2]||0,s]},QEe=({isSelected:r,object:e,objectInfo:t,originalFillFunction:n,selectedColor:i,selectedOpacity:o=255,unselectedColor:s,unselectedOpacity:c=Math.floor(255*.4)})=>r?RO({opacity:o,isSelected:!0,object:e,objectInfo:t,originalFillFunction:n})||i:RO({opacity:c,isSelected:!1,object:e,objectInfo:t,originalFillFunction:n})||s,vg={selection:{indices:{},objects:{}}},FO=(r,e)=>{const t=e.match(/{(.*?)}/g);return t&&t.forEach(n=>{const i=n.substring(1,n.length-1);r.object.hasOwnProperty(i)?e=e.replace(n,r.object[i]):r.object.hasOwnProperty("properties")&&r.object.properties.hasOwnProperty(i)&&(e=e.replace(n,r.object.properties[i]))}),e};function eTe(r,e){return e.id?r.getElementState(e.id,"selection")??vg:vg}function tTe(r,e){if(!e.id)return vg;const t=r.getStringValue(e);return(t?Q1.parse(t):null)??vg}function rTe(r,e,t,n){r.id&&e.setStringValue(r,JSON.stringify(t.value),{fromUi:t.fromUi},n)}const nTe=r=>{var J;const{height:e,width:t,expanded:n}=zO(GO),{element:i,fragmentId:o,isLightTheme:s,theme:c,widgetMgr:f}=r,{selectionMode:_,tooltip:b,useContainerWidth:T}=i,S=n??!1,[D,k]=r5({element:i,getDefaultState:eTe,getStateFromWidgetMgr:tTe,updateWidgetMgrState:rTe,widgetMgr:f,fragmentId:o}),[G,W]=Bt.useState(null),{height:z,width:j}=ice({element:i,isFullScreen:S,shouldUseContainerWidth:T,container:{height:e,width:t},heightFallback:((J=G==null?void 0:G.initialViewState)==null?void 0:J.height)||c.sizes.defaultMapHeight}),[K,fe]=Bt.useState(null),Z=_[0],ae=Z!==void 0,Be=ae&&Object.keys(D.selection.indices).length>0,Ne=Bt.useMemo(()=>Object.freeze(Q1.parse(i.json)),[S,s,i.json]),de=Bt.useMemo(()=>{var Qe;const te={...Ne};if(te.mapStyle||(te.mapStyle=s?"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json":"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"),((te==null?void 0:te.mapProvider)=="carto"||(te==null?void 0:te.mapStyle)&&((Qe=te.mapStyle)==null?void 0:Qe.indexOf("cartocdn"))>=0)&&!te.cartoKey&&(te.cartoKey="x7g2plm9yq8vfrc"),te.layers){const Ee=Object.values(D.selection.indices).some(Ge=>Ge==null?void 0:Ge.length),De=te.layers.some(Ge=>Object.hasOwn(Ge,"pickable"));te.layers=te.layers.map(Ge=>{var mt,Tt;if(!Ge||Array.isArray(Ge)||!ae)return Ge;De||(Ge.pickable=!0);const et=`${Ge.id||null}`,it=((Tt=(mt=D==null?void 0:D.selection)==null?void 0:mt.indices)==null?void 0:Tt[et])||[],rt=qEe[Ge["@@type"]];if(!rt)return Ge;const ct={...Ge};return rt.forEach(tt=>{var hr;ct.updateTriggers={[tt]:[...((hr=ct.updateTriggers)==null?void 0:hr[tt])||[],it,Ee]};const lr=!Ee,Jt=Ge[tt];if(lr||!Jt)return ct;const Wt=255,Lt=Math.floor(255*.4),sr=lB(c.colors.primary),qr=[sr[0],sr[1],sr[2],Wt],Er=lB(c.colors.gray20),pr=[Er[0],Er[1],Er[2],Lt],Mn=(dr,Zr)=>QEe({isSelected:it.includes(Zr.index),object:dr,objectInfo:Zr,originalFillFunction:Jt,selectedColor:qr,unselectedColor:pr,selectedOpacity:Wt,unselectedOpacity:Lt});ct[tt]=Mn}),ct})}return te==null||delete te.views,f9.convert(te)},[D.selection.indices,s,ae,Ne,c.colors.gray20,c.colors.primary]);Bt.useEffect(()=>{if(!WU(de.initialViewState,K)){const te=Object.keys(de.initialViewState).reduce((be,Qe)=>de.initialViewState[Qe]===(K==null?void 0:K[Qe])?be:{...be,[Qe]:de.initialViewState[Qe]},{});W(be=>({...be,...te})),fe(de.initialViewState)}},[de.initialViewState,K,G]);const _e=Bt.useCallback(te=>{if(!te||!te.object||!b)return null;const be=Q1.parse(b);return be.html?be.html=FO(te,be.html):be.text=FO(te,be.text),be},[b]),pe=Bt.useCallback(({viewState:te})=>{W(te)},[W]);return{createTooltip:_e,data:D,deck:de,hasActiveSelection:Be,height:z,isSelectionModeActivated:ae,onViewStateChange:pe,selectionMode:Z,setSelection:k,viewState:G,width:j}},iTe=()=>Df(JU,{});Ig([Yw,Ax]);const q1=vg.selection,sTe=[],oTe=r=>{var J;const{disabled:e,disableFullscreenMode:t,element:n,fragmentId:i,widgetMgr:o}=r,{libConfig:s}=Bt.useContext(XU),c=KU(),{expanded:f,expand:_,collapse:b}=zO(GO),{createTooltip:T,data:S,deck:D,hasActiveSelection:k,height:G,isSelectionModeActivated:W,onViewStateChange:z,selectionMode:j,setSelection:K,viewState:fe,width:Z}=nTe({element:n,fragmentId:i,isLightTheme:UO(c),theme:c,widgetMgr:o}),ae=n.mapboxToken||s.mapboxToken,Be=D.mapProvider=="mapbox"||(D==null?void 0:D.mapStyle)&&((J=D.mapStyle)==null?void 0:J.indexOf("mapbox"))>=0,[Ne,de]=Bt.useState(!1);Bt.useEffect(()=>{de(!0)},[]);const _e=Bt.useCallback(te=>{var rt;if(j===void 0)return;const{index:be,object:Qe}=te,Ee=`${((rt=te.layer)==null?void 0:rt.id)||null}`,De=S,Ge=be===-1,it=(()=>{var ct;if(Ge)return q1;switch(j){case fB.SelectionMode.SINGLE_OBJECT:return((ct=De.selection.indices[Ee])==null?void 0:ct[0])===be?q1:{indices:{[`${Ee}`]:[be]},objects:{[`${Ee}`]:[Qe]}};case fB.SelectionMode.MULTI_OBJECT:{const mt=new Map((()=>{var tt,lr;return(((lr=(tt=De==null?void 0:De.selection)==null?void 0:tt.indices)==null?void 0:lr[Ee])||[]).map((Jt,Wt)=>{var Lt,sr,qr;return[Jt,(qr=(sr=(Lt=De.selection)==null?void 0:Lt.objects)==null?void 0:sr[Ee])==null?void 0:qr[Wt]]})})());if(mt.has(be)?mt.delete(be):mt.set(be,Qe),mt.size===0){const{[Ee]:Tt,...tt}=De.selection.indices,{[Ee]:lr,...Jt}=De.selection.objects;return{indices:tt,objects:Jt}}return{indices:{...De.selection.indices,[`${Ee}`]:Array.from(mt.keys())},objects:{...De.selection.objects,[`${Ee}`]:Array.from(mt.values())}}}default:throw YU(j),new Error("Invalid selection mode")}})();JSON.stringify(it)!==JSON.stringify(De.selection)&&K({fromUi:!0,value:{selection:it}})},[j,S,K]),pe=Bt.useCallback(()=>{K({value:{selection:q1},fromUi:!0})},[K]);return uB(bM,{className:"stDeckGlJsonChart","data-testid":"stDeckGlJsonChart",height:G,children:[Be?Df(iTe,{}):null,Df(e5,{isFullScreen:f,disableFullscreenMode:t,onExpand:_,onCollapse:b,target:bM,locked:k&&!e?!0:void 0,children:k&&!e&&Df(QU,{label:"Clear selection",onClick:pe,icon:ZU})}),fe&&uB(gZ,{viewState:fe,onViewStateChange:z,height:G,width:Z,layers:Ne?D.layers:sTe,getTooltip:T,ContextProvider:uh.Provider,controller:!0,onClick:W&&!e?_e:void 0,children:[Df(Hl,{height:G,width:Z,mapStyle:D.mapStyle&&(typeof D.mapStyle=="string"?D.mapStyle:D.mapStyle[0]),mapboxApiAccessToken:ae}),Df(nce,{children:Df(Mte,{"data-testid":"stDeckGlJsonChartZoomButton",showCompass:!1})})]})]})},aTe=t5(oTe),hBe=Bt.memo(aTe);export{hBe as default};
|
5366
|
+
`;break;case"r":Ut+="\r";break;case"t":Ut+=" ";break;case"b":Ut+="\b";break;case"f":Ut+="\f";break;case"v":Ut+="\v";break;default:Ut+=Qr}else Ut+=Qr;return Tr||de('Unclosed quote after "'+Ut+'"',tt),{type:s,value:Ut,raw:Ar+Ut+Ar}},Sr=function(){var Ut=Lt(tt),Ar=tt,Tr;for(rt(Ut)?tt++:de("Unexpected "+Wt(tt),tt);tt<sr&&(Ut=Lt(tt),ct(Ut));)tt++;return Tr=Tt.slice(Ar,tt),Ee.hasOwnProperty(Tr)?{type:s,value:Ee[Tr],raw:Tr}:Tr===De?{type:c}:{type:i,name:Tr}},ei=function(Ut){for(var Ar,Tr=[],Qr,ui=!1,Pe=0;tt<sr;)if(qr(),Ar=Lt(tt),Ar===Ut){ui=!0,tt++,Ut===K&&Pe&&Pe>=Tr.length&&de("Unexpected token "+String.fromCharCode(Ut),tt);break}else if(Ar===G){if(tt++,Pe++,Pe!==Tr.length){if(Ut===K)de("Unexpected token ,",tt);else if(Ut===Z)for(var Dt=Tr.length;Dt<Pe;Dt++)Tr.push(null)}}else Qr=Er(),(!Qr||Qr.type===n)&&de("Expected comma",tt),Tr.push(Qr);return ui||de("Expected "+String.fromCharCode(Ut),tt),Tr},$n=function(){var Ut,Ar;for(Ut=Lt(tt),Ut===j?Ar=un():Ar=Sr(),qr(),Ut=Lt(tt);Ut===k||Ut===fe||Ut===j;)tt++,Ut===k?(qr(),Ar={type:o,computed:!1,object:Ar,property:Sr()}):Ut===fe?(Ar={type:o,computed:!0,object:Ar,property:Er()},qr(),Ut=Lt(tt),Ut!==Z&&de("Unclosed [",tt),tt++):Ut===j&&(Ar={type:f,arguments:ei(K),callee:Ar}),qr(),Ut=Lt(tt);return Ar},un=function(){tt++;var Ut=Er();if(qr(),Lt(tt)===K)return tt++,Ut;de("Unclosed (",tt)},Xn=function(){return tt++,{type:D,elements:ei(Z)}},kn=[],bn,Wn;tt<sr;)bn=Lt(tt),bn===Be||bn===G?tt++:(Wn=Er())?kn.push(Wn):tt<sr&&de('Unexpected "'+Wt(tt)+'"',tt);return kn.length===1?kn[0]:{type:n,body:kn}};mt.version="0.3.5",mt.toString=function(){return"JavaScript Expression Parser (JSEP) v"+mt.version},mt.addUnaryOp=function(Tt){return be=Math.max(Tt.length,be),pe[Tt]=_e,this},mt.addBinaryOp=function(Tt,tt){return Qe=Math.max(Tt.length,Qe),J[Tt]=tt,this},mt.addLiteral=function(Tt,tt){return Ee[Tt]=tt,this},mt.removeUnaryOp=function(Tt){return delete pe[Tt],Tt.length===be&&(be=te(pe)),this},mt.removeAllUnaryOps=function(){return pe={},be=0,this},mt.removeBinaryOp=function(Tt){return delete J[Tt],Tt.length===Qe&&(Qe=te(J)),this},mt.removeAllBinaryOps=function(){return J={},Qe=0,this},mt.removeLiteral=function(Tt){return delete Ee[Tt],this},mt.removeAllLiterals=function(){return Ee={},this},r.exports?e=r.exports=mt:e.parse=mt})()}(bm,bm.exports)),bm.exports}var FEe=REe();const OEe=ih(FEe),BO={"||":(r,e)=>r||e,"&&":(r,e)=>r&&e,"|":(r,e)=>r|e,"^":(r,e)=>r^e,"&":(r,e)=>r&e,"==":(r,e)=>r==e,"!=":(r,e)=>r!=e,"===":(r,e)=>r===e,"!==":(r,e)=>r!==e,"<":(r,e)=>r<e,">":(r,e)=>r>e,"<=":(r,e)=>r<=e,">=":(r,e)=>r>=e,"<<":(r,e)=>r<<e,">>":(r,e)=>r>>e,">>>":(r,e)=>r>>>e,"+":(r,e)=>r+e,"-":(r,e)=>r-e,"*":(r,e)=>r*e,"/":(r,e)=>r/e,"%":(r,e)=>r%e},DEe={"-":r=>-r,"+":r=>+r,"~":r=>~r,"!":r=>!r};function SO(r,e){return r.map(function(t){return Vs(t,e)})}function IO(r,e){const t=Vs(r.object,e);let n;if(r.computed?n=Vs(r.property,e):n=r.property.name,/^__proto__|prototype|constructor$/.test(n))throw Error(`Access to member "${n}" disallowed.`);return[t,t[n]]}function Vs(r,e){const t=r;switch(t.type){case"ArrayExpression":return SO(t.elements,e);case"BinaryExpression":return BO[t.operator](Vs(t.left,e),Vs(t.right,e));case"CallExpression":let n,i,o;return t.callee.type==="MemberExpression"?(o=IO(t.callee,e),n=o[0],i=o[1]):i=Vs(t.callee,e),typeof i!="function"?void 0:i.apply(n,SO(t.arguments,e));case"ConditionalExpression":return Vs(t.test,e)?Vs(t.consequent,e):Vs(t.alternate,e);case"Identifier":return e[t.name];case"Literal":return t.value;case"LogicalExpression":return t.operator==="||"?Vs(t.left,e)||Vs(t.right,e):t.operator==="&&"?Vs(t.left,e)&&Vs(t.right,e):BO[t.operator](Vs(t.left,e),Vs(t.right,e));case"MemberExpression":return IO(t,e)[1];case"ThisExpression":return e;case"UnaryExpression":return DEe[t.operator](Vs(t.argument,e));default:return}}const Y1={"-":r=>r};function c9(r,e){if(r in Y1)return Y1[r];let t;const n=OEe(r);return n.type==="Identifier"?t=i=>IEe(i,r):(Kx(n,i=>{if(i.type==="CallExpression")throw new Error("Function calls not allowed in JSON expressions")}),t=i=>Vs(n,i)),Y1[r]=t,t}function Kx(r,e){if(Array.isArray(r))r.forEach(t=>Kx(t,e));else if(r&&typeof r=="object"){r.type&&e(r);for(const t in r)Kx(r[t],e)}}const V_="@@=",MO="@@#",LEe="@@type",l9="@@function",PO=r=>r&&typeof r=="object";class Yx{constructor(...e){this.typeKey=LEe,this.functionKey=l9,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=c9,this.preProcessClassProps=(t,n)=>n,this.postProcessConvertedJson=t=>t;for(const t of e)this.merge(t)}merge(e){for(const t in e)switch(t){case"layers":case"views":Object.assign(this.classes,e[t]);break;default:if(t in this){const n=e[t];this[t]=PO(this[t])?Object.assign(this[t],n):n}}}validate(e){return Xx(!this.typeKey||typeof this.typeKey=="string"),Xx(PO(this.classes)),!0}}function NEe(r){return typeof r=="string"&&r.startsWith(V_)}function kEe(r){return r.replace(V_,"")}function u9(r,e){const t={};for(const n in r){let i=r[n];NEe(i)&&(i=kEe(i),i=c9(i)),t[n]=i}return t}function UEe(r,e,t){const n=t.classes[r],i=t.reactComponents[r];if(!n&&!i){const{log:o}=t;if(o){const s=JSON.stringify(e,null,0).slice(0,40);o.warn(`JSON converter: No registered class of type ${r}(${s}...) `)}return null}return n?zEe(n,e,t):GEe(i,e,t)}function zEe(r,e,t){return t.preProcessClassProps&&(e=t.preProcessClassProps(r,e,t)),e=u9(e),new r(e)}function GEe(r,e,t){const{React:n}=t,{children:i=[]}=e;return delete e.children,t.preProcessClassProps&&(e=t.preProcessClassProps(r,e,t)),e=u9(e),n.createElement(r,e,i)}function VEe(r,e,t){const n=t.functions[r];if(!n){const{log:i}=t;if(i){const o=JSON.stringify(e,null,0).slice(0,40);i.warn(`JSON converter: No registered function ${r}(${o}...) `)}return null}return n(e)}function HEe(r){return typeof r=="string"?JSON.parse(r):r}const zE=r=>r&&typeof r=="object";class jEe{constructor(e){this.log=console,this.onJSONChange=()=>{},this.json=null,this.convertedJson=null,this.setProps(e)}finalize(){}setProps(e){"configuration"in e&&(this.configuration=e.configuration instanceof Yx?e.configuration:new Yx(e.configuration)),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}mergeConfiguration(e){this.configuration.merge(e)}convert(e){if(!e||e===this.json)return this.convertedJson;this.json=e;const t=HEe(e);let n=$Ee(t,this.configuration);return n=this.configuration.postProcessConvertedJson(n),this.convertedJson=n,n}convertJson(e){return this.convert(e)}}function $Ee(r,e){return e=new Yx(e),GE(r,"",e)}function GE(r,e,t){return Array.isArray(r)?r.map((n,i)=>GE(n,String(i),t)):WEe(r,t)?JEe(r,t):zE(r)?l9 in r?XEe(r,t):VE(r,t):typeof r=="string"?KEe(r,e,t):r}function WEe(r,e){const{typeKey:t}=e;return zE(r)&&!!r[t]}function JEe(r,e){const{typeKey:t}=e,n=r[t];let i={...r};return delete i[t],i=VE(i,e),UEe(n,i,e)}function XEe(r,e){const{functionKey:t}=e,n=r[t];let i={...r};return delete i[t],i=VE(i,e),VEe(n,i,e)}function VE(r,e){Xx(zE(r));const t={};for(const n in r){const i=r[n];t[n]=GE(i,n,e)}return t}function KEe(r,e,t){if(r.startsWith(V_)&&t.convertFunction)return r=r.replace(V_,""),t.convertFunction(r,t);if(r.startsWith(MO)){if(r=r.replace(MO,""),t.constants[r])return t.constants[r];const[n,i]=r.split(".");return t.enumerations[n][i]}return r}const YEe={classes:{..._ue,...BEe,...d2e,...ame,...SEe},functions:{colorBins:Zwe,colorCategories:Qwe,colorContinuous:eCe}},f9=new jEe({configuration:YEe}),qEe={[Xy.layerName]:["getFillColor"],[Ny.layerName]:["getFillColor"],[sl.layerName]:["getFillColor"],[DA.layerName]:["getFillColor"],[Py.layerName]:["getFillColor"],[My.layerName]:["getFillColor"],[Oy.layerName]:["getColor"],[Mg.layerName]:["getTargetColor","getSourceColor"],[il.layerName]:["getFillColor"],[jl.layerName]:["getFillColor"],[OA.layerName]:["getColor"],[Ty.layerName]:["getColor"],[Yu.layerName]:["getColor"],[Pg.layerName]:["getColor"],[Zu.layerName]:["getFillColor"],[Rg.layerName]:["getFillColor","getColor","getLineColor"],[qu.layerName]:["getFillColor"],[dh.layerName]:["getColor"],[Ug.layerName]:["getColor"],[th.layerName]:["getColor"]},ZEe=({object:r,objectInfo:e,originalFillFunction:t})=>{const n=typeof t=="function"?t(r,e):t;if(Array.isArray(n))return[n[0]||0,n[1]||0,n[2]||0,n[3]||255];if(typeof n=="string"&&n.startsWith("@@=")){const i=f9.convert({originalColor:n}).originalColor(r);return[i[0]||0,i[1]||0,i[2]||0,i[3]||255]}return null},RO=({isSelected:r,object:e,objectInfo:t,opacity:n,originalFillFunction:i})=>{const o=ZEe({object:e,objectInfo:t,originalFillFunction:i});if(!o)return null;let s=0;return r?s=Math.max(typeof o[3]=="number"?o[3]:n,n):s=Math.min(typeof o[3]=="number"?o[3]:n,n),[o[0]||0,o[1]||0,o[2]||0,s]},QEe=({isSelected:r,object:e,objectInfo:t,originalFillFunction:n,selectedColor:i,selectedOpacity:o=255,unselectedColor:s,unselectedOpacity:c=Math.floor(255*.4)})=>r?RO({opacity:o,isSelected:!0,object:e,objectInfo:t,originalFillFunction:n})||i:RO({opacity:c,isSelected:!1,object:e,objectInfo:t,originalFillFunction:n})||s,vg={selection:{indices:{},objects:{}}},FO=(r,e)=>{const t=e.match(/{(.*?)}/g);return t&&t.forEach(n=>{const i=n.substring(1,n.length-1);Object.hasOwn(r.object,i)?e=e.replace(n,r.object[i]):Object.hasOwn(r.object,"properties")&&Object.hasOwn(r.object.properties,i)&&(e=e.replace(n,r.object.properties[i]))}),e};function eTe(r,e){return e.id?r.getElementState(e.id,"selection")??vg:vg}function tTe(r,e){if(!e.id)return vg;const t=r.getStringValue(e);return(t?Q1.parse(t):null)??vg}function rTe(r,e,t,n){r.id&&e.setStringValue(r,JSON.stringify(t.value),{fromUi:t.fromUi},n)}const nTe=r=>{var J;const{height:e,width:t,expanded:n}=zO(GO),{element:i,fragmentId:o,isLightTheme:s,theme:c,widgetMgr:f}=r,{selectionMode:_,tooltip:b,useContainerWidth:T}=i,S=n??!1,[D,k]=r5({element:i,getDefaultState:eTe,getStateFromWidgetMgr:tTe,updateWidgetMgrState:rTe,widgetMgr:f,fragmentId:o}),[G,W]=Bt.useState(null),{height:z,width:j}=ice({element:i,isFullScreen:S,shouldUseContainerWidth:T,container:{height:e,width:t},heightFallback:((J=G==null?void 0:G.initialViewState)==null?void 0:J.height)||c.sizes.defaultMapHeight}),[K,fe]=Bt.useState(null),Z=_[0],ae=Z!==void 0,Be=ae&&Object.keys(D.selection.indices).length>0,Ne=Bt.useMemo(()=>Object.freeze(Q1.parse(i.json)),[S,s,i.json]),de=Bt.useMemo(()=>{var Qe;const te={...Ne};if(te.mapStyle||(te.mapStyle=s?"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json":"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"),((te==null?void 0:te.mapProvider)=="carto"||(te==null?void 0:te.mapStyle)&&((Qe=te.mapStyle)==null?void 0:Qe.indexOf("cartocdn"))>=0)&&!te.cartoKey&&(te.cartoKey="x7g2plm9yq8vfrc"),te.layers){const Ee=Object.values(D.selection.indices).some(Ge=>Ge==null?void 0:Ge.length),De=te.layers.some(Ge=>Object.hasOwn(Ge,"pickable"));te.layers=te.layers.map(Ge=>{var mt,Tt;if(!Ge||Array.isArray(Ge)||!ae)return Ge;De||(Ge.pickable=!0);const et=`${Ge.id||null}`,it=((Tt=(mt=D==null?void 0:D.selection)==null?void 0:mt.indices)==null?void 0:Tt[et])||[],rt=qEe[Ge["@@type"]];if(!rt)return Ge;const ct={...Ge};return rt.forEach(tt=>{var hr;ct.updateTriggers={[tt]:[...((hr=ct.updateTriggers)==null?void 0:hr[tt])||[],it,Ee]};const lr=!Ee,Jt=Ge[tt];if(lr||!Jt)return ct;const Wt=255,Lt=Math.floor(255*.4),sr=lB(c.colors.primary),qr=[sr[0],sr[1],sr[2],Wt],Er=lB(c.colors.gray20),pr=[Er[0],Er[1],Er[2],Lt],Mn=(dr,Zr)=>QEe({isSelected:it.includes(Zr.index),object:dr,objectInfo:Zr,originalFillFunction:Jt,selectedColor:qr,unselectedColor:pr,selectedOpacity:Wt,unselectedOpacity:Lt});ct[tt]=Mn}),ct})}return te==null||delete te.views,f9.convert(te)},[D.selection.indices,s,ae,Ne,c.colors.gray20,c.colors.primary]);Bt.useEffect(()=>{if(!WU(de.initialViewState,K)){const te=Object.keys(de.initialViewState).reduce((be,Qe)=>de.initialViewState[Qe]===(K==null?void 0:K[Qe])?be:{...be,[Qe]:de.initialViewState[Qe]},{});W(be=>({...be,...te})),fe(de.initialViewState)}},[de.initialViewState,K,G]);const _e=Bt.useCallback(te=>{if(!te||!te.object||!b)return null;const be=Q1.parse(b);return be.html?be.html=FO(te,be.html):be.text=FO(te,be.text),be},[b]),pe=Bt.useCallback(({viewState:te})=>{W(te)},[W]);return{createTooltip:_e,data:D,deck:de,hasActiveSelection:Be,height:z,isSelectionModeActivated:ae,onViewStateChange:pe,selectionMode:Z,setSelection:k,viewState:G,width:j}},iTe=()=>Df(JU,{});Ig([Yw,Ax]);const q1=vg.selection,sTe=[],oTe=r=>{var J;const{disabled:e,disableFullscreenMode:t,element:n,fragmentId:i,widgetMgr:o}=r,{libConfig:s}=Bt.useContext(XU),c=KU(),{expanded:f,expand:_,collapse:b}=zO(GO),{createTooltip:T,data:S,deck:D,hasActiveSelection:k,height:G,isSelectionModeActivated:W,onViewStateChange:z,selectionMode:j,setSelection:K,viewState:fe,width:Z}=nTe({element:n,fragmentId:i,isLightTheme:UO(c),theme:c,widgetMgr:o}),ae=n.mapboxToken||s.mapboxToken,Be=D.mapProvider=="mapbox"||(D==null?void 0:D.mapStyle)&&((J=D.mapStyle)==null?void 0:J.indexOf("mapbox"))>=0,[Ne,de]=Bt.useState(!1);Bt.useEffect(()=>{de(!0)},[]);const _e=Bt.useCallback(te=>{var rt;if(j===void 0)return;const{index:be,object:Qe}=te,Ee=`${((rt=te.layer)==null?void 0:rt.id)||null}`,De=S,Ge=be===-1,it=(()=>{var ct;if(Ge)return q1;switch(j){case fB.SelectionMode.SINGLE_OBJECT:return((ct=De.selection.indices[Ee])==null?void 0:ct[0])===be?q1:{indices:{[`${Ee}`]:[be]},objects:{[`${Ee}`]:[Qe]}};case fB.SelectionMode.MULTI_OBJECT:{const mt=new Map((()=>{var tt,lr;return(((lr=(tt=De==null?void 0:De.selection)==null?void 0:tt.indices)==null?void 0:lr[Ee])||[]).map((Jt,Wt)=>{var Lt,sr,qr;return[Jt,(qr=(sr=(Lt=De.selection)==null?void 0:Lt.objects)==null?void 0:sr[Ee])==null?void 0:qr[Wt]]})})());if(mt.has(be)?mt.delete(be):mt.set(be,Qe),mt.size===0){const{[Ee]:Tt,...tt}=De.selection.indices,{[Ee]:lr,...Jt}=De.selection.objects;return{indices:tt,objects:Jt}}return{indices:{...De.selection.indices,[`${Ee}`]:Array.from(mt.keys())},objects:{...De.selection.objects,[`${Ee}`]:Array.from(mt.values())}}}default:throw YU(j),new Error("Invalid selection mode")}})();JSON.stringify(it)!==JSON.stringify(De.selection)&&K({fromUi:!0,value:{selection:it}})},[j,S,K]),pe=Bt.useCallback(()=>{K({value:{selection:q1},fromUi:!0})},[K]);return uB(bM,{className:"stDeckGlJsonChart","data-testid":"stDeckGlJsonChart",height:G,children:[Be?Df(iTe,{}):null,Df(e5,{isFullScreen:f,disableFullscreenMode:t,onExpand:_,onCollapse:b,target:bM,locked:k&&!e?!0:void 0,children:k&&!e&&Df(QU,{label:"Clear selection",onClick:pe,icon:ZU})}),fe&&uB(gZ,{viewState:fe,onViewStateChange:z,height:G,width:Z,layers:Ne?D.layers:sTe,getTooltip:T,ContextProvider:uh.Provider,controller:!0,onClick:W&&!e?_e:void 0,children:[Df(Hl,{height:G,width:Z,mapStyle:D.mapStyle&&(typeof D.mapStyle=="string"?D.mapStyle:D.mapStyle[0]),mapboxApiAccessToken:ae}),Df(nce,{children:Df(Mte,{"data-testid":"stDeckGlJsonChartZoomButton",showCompass:!1})})]})]})},aTe=t5(oTe),hBe=Bt.memo(aTe);export{hBe as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as e,r as a,C as t,j as r,aC as o}from"./index.
|
1
|
+
import{n as e,r as a,C as t,j as r,aC as o}from"./index.PoIwzrI7.js";import{P as i}from"./ProgressBar.DfcVR_JA.js";const l=e("div",{target:"e1675qd10"})(({theme:s})=>({paddingBottom:s.spacing.sm,lineHeight:"normal"}));function n({element:s}){return t("div",{className:"stProgress","data-testid":"stProgress",children:[r(l,{children:r(o,{source:s.text,allowHTML:!1,isLabel:!0})}),r(i,{value:s.value})]})}const m=a.memo(n);export{m as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as k,r as s,bd as H,z as B,cp as W,C as j,j as r,bo as q,bC as O,bp as _,b5 as w,bq as K,D as $,cq as A}from"./index.
|
1
|
+
import{n as k,r as s,bd as H,z as B,cp as W,C as j,j as r,bo as q,bC as O,bp as _,b5 as w,bq as K,D as $,cq as A}from"./index.PoIwzrI7.js";import{u as G}from"./uniqueId.BV5h1uCx.js";import{u as N,a as J,b as M}from"./useOnInputChange.sGAnyCSU.js";import{a as Q}from"./useBasicWidgetState.DzE2MsN8.js";import{I as X}from"./InputInstructions.DI9h4PJ7.js";import{I as Y}from"./input.B3uNJm6d.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.Dd0v0IXt.js";import"./base-input.BmA1ZV9Y.js";const Z=k("div",{target:"e1o1zy6o0"})("position:relative;");function tt({disabled:a,element:t,widgetMgr:o,fragmentId:d}){var I;const[l,c]=s.useState(()=>y(o,t)??null),[T,x]=H(),[i,p]=s.useState(!1),C=s.useCallback(()=>{c(t.default??null),p(!0)},[t.default]),[V,m]=Q({getStateFromWidgetMgr:y,getDefaultStateFromProto:et,getCurrStateFromProto:at,updateWidgetMgrState:st,element:t,widgetMgr:o,fragmentId:d,onFormCleared:C});N(V,l,c,i);const[F,g]=s.useState(!1),e=B(),[b]=s.useState(()=>G("text_input_")),{placeholder:z,formId:u,icon:n,maxChars:f}=t,h=s.useCallback(()=>{p(!1),m({value:l,fromUi:!0})},[l,m]),v=W({formId:u})?o.allowFormEnterToSubmit(u):i,E=F&&T>e.breakpoints.hideWidgetDetails,R=s.useCallback(()=>{i&&h(),g(!1)},[i,h]),L=s.useCallback(()=>{g(!0)},[]),P=J({formId:u,maxChars:f,setDirty:p,setUiValue:c,setValueWithSource:m}),D=M(u,h,i,o,d),S=n==null?void 0:n.startsWith(":material"),U=S?"lg":"base";return j(Z,{className:"stTextInput","data-testid":"stTextInput",ref:x,children:[r(K,{label:t.label,disabled:a,labelVisibility:q((I=t.labelVisibility)==null?void 0:I.value),htmlFor:b,children:t.help&&r(O,{children:r(_,{content:t.help,placement:w.TOP_RIGHT})})}),r(Y,{value:l??"",placeholder:z,onBlur:R,onFocus:L,onChange:P,onKeyPress:D,"aria-label":t.label,disabled:a,id:b,type:ot(t),autoComplete:t.autocomplete,startEnhancer:n&&r($,{"data-testid":"stTextInputIcon",iconValue:n,size:U}),overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:e.lineHeights.inputWidget,paddingRight:e.spacing.sm,paddingLeft:e.spacing.md,paddingBottom:e.spacing.sm,paddingTop:e.spacing.sm}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth,paddingLeft:n?e.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:e.iconSizes.lg,color:S?e.colors.fadedText60:"inherit"}}}}),E&&r(X,{dirty:i,value:l??"",maxLength:f,inForm:W({formId:u}),allowEnterToSubmit:v})]})}function y(a,t){return a.getStringValue(t)??null}function et(a){return a.default??null}function at(a){return a.value??null}function st(a,t,o,d){t.setStringValue(a,o.value,{fromUi:o.fromUi},d)}function ot(a){return a.type===A.Type.PASSWORD?"password":"text"}const ht=s.memo(tt);export{ht as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{r as y,E as T,_ as O,n as I,J as K,C as P,j as f,br as Y,b5 as $,bm as Z,b0 as ee,bl as W,by as z,d as te,g as re,aM as ie,z as oe,bz as ae,bA as ne,bB as se,l as le,aA as de,M as x,bi as ce,bh as ue,bo as he,bC as pe,bp as fe,bq as ge,F as me}from"./index.PoIwzrI7.js";import{a as L,U as k}from"./UploadFileInfo.0DCkpDDf.js";import{F as ve}from"./FormClearHelper.Dd0v0IXt.js";import{P as Se,S as ye}from"./ProgressBar.DfcVR_JA.js";var N=y.forwardRef(function(t,l){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(T,O({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:l}),y.createElement("path",{d:"M.5 1c-.28 0-.5.23-.5.5v4c0 .28.23.5.5.5h5c.28 0 .5-.22.5-.5V4l1 1h1V2H7L6 3V1.5c0-.28-.22-.5-.5-.5h-5z"}))});N.displayName="Video";var H=y.forwardRef(function(t,l){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(T,O({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:l}),y.createElement("path",{d:"M1.41 0L0 1.41l.72.72L2.5 3.94.72 5.72 0 6.41l1.41 1.44.72-.72 1.81-1.81 1.78 1.81.69.72 1.44-1.44-.72-.69-1.81-1.78 1.81-1.81.72-.72L6.41 0l-.69.72L3.94 2.5 2.13.72 1.41 0z"}))});H.displayName="X";var D=y.forwardRef(function(t,l){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(T,O({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:l}),y.createElement("rect",{width:24,height:24,fill:"none"}),y.createElement("path",{d:"M20 5h-3.17l-1.24-1.35A1.99 1.99 0 0014.12 3H9.88c-.56 0-1.1.24-1.48.65L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-1.35 8.35l-2.79 2.79c-.32.32-.86.1-.86-.35v-1.75H9v1.75c0 .45-.54.67-.85.35l-2.79-2.79c-.2-.2-.2-.51 0-.71l2.79-2.79a.5.5 0 01.85.36v1.83h6v-1.83c0-.45.54-.67.85-.35l2.79 2.79c.2.19.2.51.01.7z"}))});D.displayName="SwitchCamera";var j;(function(t){t.XSMALL="xsmall",t.SMALL="small",t.MEDIUM="medium",t.LARGE="large"})(j||(j={}));function be(t,l){switch(t){case"xsmall":return{padding:`${l.spacing.twoXS} ${l.spacing.sm}`,fontSize:l.fontSizes.sm};case"small":return{padding:`${l.spacing.twoXS} ${l.spacing.md}`};case"large":return{padding:`${l.spacing.md} ${l.spacing.md}`};default:return{padding:`${l.spacing.xs} ${l.spacing.md}`}}}const G=I("div",{target:"e14dwhi20"})({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"}),V=I("div",{target:"e14dwhi21"})(({theme:t,width:l})=>({backgroundColor:t.colors.secondaryBg,borderRadius:`${t.radii.default} ${t.radii.default} 0 0`,width:"100%",height:l*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"})),we=I("p",{target:"e14dwhi22"})(({theme:t})=>({marginTop:t.spacing.sm,textAlign:"center"})),Me=I("img",{target:"e14dwhi23"})(({theme:t,opacity:l})=>({borderRadius:`${t.radii.default} ${t.radii.default} 0 0`,objectFit:"contain",opacity:l})),Ce=I("a",{target:"e14dwhi24"})(({theme:t})=>({color:t.colors.primary,display:"block",textDecoration:"none"})),Ue=I("span",{target:"e14dwhi25"})({display:"flex",alignItems:"center"}),Ie=I("div",{target:"e14dwhi26"})(({theme:t})=>({position:"absolute",top:t.spacing.lg,right:t.spacing.lg,zIndex:t.zIndices.priority,color:t.colors.fadedText40,mixBlendMode:"difference",opacity:.6})),Ee=I("div",{target:"e14dwhi28"})({height:"fit-content",width:"100%",position:"absolute",bottom:0}),Fe=I("button",{target:"e14dwhi29"})(({theme:t})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:t.colors.lightenedBg05,border:`${t.sizes.borderWidth} solid ${t.colors.borderColor}`,borderRadius:`0 0 ${t.radii.default} ${t.radii.default}`,"&:hover":{borderColor:t.colors.primary,color:t.colors.primary},"&:active":{color:t.colors.white,borderColor:t.colors.primary,backgroundColor:t.colors.primary},"&:focus:not(:active)":{borderColor:t.colors.primary,color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:t.colors.fadedText40,borderColor:t.colors.borderColor,backgroundColor:t.colors.lightenedBg05,cursor:"not-allowed"},fontWeight:t.fontWeights.normal,padding:`${t.spacing.xs} ${t.spacing.md}`,margin:t.spacing.none,lineHeight:t.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${K(t.colors.primary,.5)}`},...be("medium",t)}));function Pe({disabled:t,onClick:l,children:r,progress:a}){return P(Fe,{disabled:t||!1,onClick:l||(()=>{}),progress:a||null,"data-testid":"stCameraInputButton",children:[r,a?f(Ee,{children:f(Se,{value:a,size:ye.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})}):null]})}const q=y.memo(Pe);var F;(function(t){t.USER="user",t.ENVIRONMENT="environment"})(F||(F={}));const Re=({switchFacingMode:t})=>f(Ie,{"data-testid":"stCameraInputSwitchButton",children:f(Y,{content:"Switch camera",placement:$.TOP_RIGHT,children:f(Z,{kind:ee.MINIMAL,onClick:t,children:f(W,{content:D,size:"twoXL",color:z.white})})})}),xe=y.memo(Re);var _={exports:{}},_e=_.exports,B;function Te(){return B||(B=1,function(t,l){(function(a,o){t.exports=o(te())})(_e,function(r){return function(a){var o={};function n(s){if(o[s])return o[s].exports;var h=o[s]={i:s,l:!1,exports:{}};return a[s].call(h.exports,h,h.exports,n),h.l=!0,h.exports}return n.m=a,n.c=o,n.d=function(s,h,g){n.o(s,h)||Object.defineProperty(s,h,{enumerable:!0,get:g})},n.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},n.t=function(s,h){if(h&1&&(s=n(s)),h&8||h&4&&typeof s=="object"&&s&&s.__esModule)return s;var g=Object.create(null);if(n.r(g),Object.defineProperty(g,"default",{enumerable:!0,value:s}),h&2&&typeof s!="string")for(var U in s)n.d(g,U,(function(C){return s[C]}).bind(null,U));return g},n.n=function(s){var h=s&&s.__esModule?function(){return s.default}:function(){return s};return n.d(h,"a",h),h},n.o=function(s,h){return Object.prototype.hasOwnProperty.call(s,h)},n.p="",n(n.s="./src/react-webcam.tsx")}({"./src/react-webcam.tsx":function(a,o,n){n.r(o);var s=n("react"),h=function(){var m=function(u,e){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,d){i.__proto__=d}||function(i,d){for(var c in d)d.hasOwnProperty(c)&&(i[c]=d[c])},m(u,e)};return function(u,e){m(u,e);function i(){this.constructor=u}u.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}}(),g=function(){return g=Object.assign||function(m){for(var u,e=1,i=arguments.length;e<i;e++){u=arguments[e];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(m[d]=u[d])}return m},g.apply(this,arguments)},U=function(m,u){var e={};for(var i in m)Object.prototype.hasOwnProperty.call(m,i)&&u.indexOf(i)<0&&(e[i]=m[i]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,i=Object.getOwnPropertySymbols(m);d<i.length;d++)u.indexOf(i[d])<0&&Object.prototype.propertyIsEnumerable.call(m,i[d])&&(e[i[d]]=m[i[d]]);return e};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(u){var e=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return e?new Promise(function(i,d){e.call(navigator,u,i,d)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function C(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var E=function(m){h(u,m);function u(e){var i=m.call(this,e)||this;return i.canvas=null,i.ctx=null,i.requestUserMediaId=0,i.unmounted=!1,i.state={hasUserMedia:!1},i}return u.prototype.componentDidMount=function(){var e=this,i=e.state,d=e.props;if(this.unmounted=!1,!C()){d.onUserMediaError("getUserMedia not supported");return}i.hasUserMedia||this.requestUserMedia(),d.children&&typeof d.children!="function"&&console.warn("children must be a function")},u.prototype.componentDidUpdate=function(e){var i=this.props;if(!C()){i.onUserMediaError("getUserMedia not supported");return}var d=JSON.stringify(e.audioConstraints)!==JSON.stringify(i.audioConstraints),c=JSON.stringify(e.videoConstraints)!==JSON.stringify(i.videoConstraints),w=e.minScreenshotWidth!==i.minScreenshotWidth,S=e.minScreenshotHeight!==i.minScreenshotHeight;(c||w||S)&&(this.canvas=null,this.ctx=null),(d||c)&&(this.stopAndCleanup(),this.requestUserMedia())},u.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},u.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map(function(i){e.removeTrack(i),i.stop()}),e.getAudioTracks().map(function(i){e.removeTrack(i),i.stop()})):e.stop())},u.prototype.stopAndCleanup=function(){var e=this.state;e.hasUserMedia&&(u.stopMediaStream(this.stream),e.src&&window.URL.revokeObjectURL(e.src))},u.prototype.getScreenshot=function(e){var i=this,d=i.state,c=i.props;if(!d.hasUserMedia)return null;var w=this.getCanvas(e);return w&&w.toDataURL(c.screenshotFormat,c.screenshotQuality)},u.prototype.getCanvas=function(e){var i=this,d=i.state,c=i.props;if(!this.video||!d.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var w=this.video.videoWidth,S=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var v=w/S;w=c.minScreenshotWidth||this.video.clientWidth,S=w/v,c.minScreenshotHeight&&S<c.minScreenshotHeight&&(S=c.minScreenshotHeight,w=S*v)}this.canvas=document.createElement("canvas"),this.canvas.width=(e==null?void 0:e.width)||w,this.canvas.height=(e==null?void 0:e.height)||S,this.ctx=this.canvas.getContext("2d")}var M=this,b=M.ctx,p=M.canvas;return b&&p&&(p.width=(e==null?void 0:e.width)||p.width,p.height=(e==null?void 0:e.height)||p.height,c.mirrored&&(b.translate(p.width,0),b.scale(-1,1)),b.imageSmoothingEnabled=c.imageSmoothing,b.drawImage(this.video,0,0,(e==null?void 0:e.width)||p.width,(e==null?void 0:e.height)||p.height),c.mirrored&&(b.scale(-1,1),b.translate(-p.width,0))),p},u.prototype.requestUserMedia=function(){var e=this,i=this.props,d=function(S,v){var M={video:typeof v<"u"?v:!0};i.audio&&(M.audio=typeof S<"u"?S:!0),e.requestUserMediaId++;var b=e.requestUserMediaId;navigator.mediaDevices.getUserMedia(M).then(function(p){e.unmounted||b!==e.requestUserMediaId?u.stopMediaStream(p):e.handleUserMedia(null,p)}).catch(function(p){e.handleUserMedia(p)})};if("mediaDevices"in navigator)d(i.audioConstraints,i.videoConstraints);else{var c=function(S){return{optional:[{sourceId:S}]}},w=function(S){var v=S.deviceId;return typeof v=="string"?v:Array.isArray(v)&&v.length>0?v[0]:typeof v=="object"&&v.ideal?v.ideal:null};MediaStreamTrack.getSources(function(S){var v=null,M=null;S.forEach(function(R){R.kind==="audio"?v=R.id:R.kind==="video"&&(M=R.id)});var b=w(i.audioConstraints);b&&(v=b);var p=w(i.videoConstraints);p&&(M=p),d(c(v),c(M))})}},u.prototype.handleUserMedia=function(e,i){var d=this.props;if(e||!i){this.setState({hasUserMedia:!1}),d.onUserMediaError(e);return}this.stream=i;try{this.video&&(this.video.srcObject=i),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(i)})}d.onUserMedia(i)},u.prototype.render=function(){var e=this,i=this,d=i.state,c=i.props,w=c.audio;c.forceScreenshotSourceSize;var S=c.disablePictureInPicture;c.onUserMedia,c.onUserMediaError,c.screenshotFormat,c.screenshotQuality,c.minScreenshotWidth,c.minScreenshotHeight,c.audioConstraints,c.videoConstraints,c.imageSmoothing;var v=c.mirrored,M=c.style,b=M===void 0?{}:M,p=c.children,R=U(c,["audio","forceScreenshotSourceSize","disablePictureInPicture","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),X=v?g(g({},b),{transform:(b.transform||"")+" scaleX(-1)"}):b,J={getScreenshot:this.getScreenshot.bind(this)};return s.createElement(s.Fragment,null,s.createElement("video",g({autoPlay:!0,disablePictureInPicture:S,src:d.src,muted:!w,playsInline:!0,ref:function(Q){e.video=Q},style:X},R)),p&&p(J))},u.defaultProps={audio:!1,disablePictureInPicture:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},u}(s.Component);o.default=E},react:function(a,o){a.exports=r}}).default})}(_)),_.exports}var Oe=Te();const We=re(Oe);var A;(function(t){t.PENDING="pending",t.SUCCESS="success",t.ERROR="error"})(A||(A={}));const Ve=({width:t})=>P(V,{width:t,children:[f(W,{size:"threeXL",color:z.gray60,content:N}),P(we,{children:["This app would like to use your camera.",f(Ce,{href:ne,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),Le=({handleCapture:t,width:l,disabled:r,clearPhotoInProgress:a,setClearPhotoInProgress:o,facingMode:n,setFacingMode:s,testOverride:h})=>{const[g,U]=y.useState(h||"pending"),C=y.useRef(null),[E,m]=y.useState(l),u=y.useCallback(ie(1e3,m),[]);y.useEffect(()=>{u(l)},[l,u]);function e(){if(C.current!==null){const d=C.current.getScreenshot();t(d)}}const i=oe();return P(G,{"data-testid":"stCameraInputWebcamComponent",children:[g!=="success"&&!r&&!a?f(Ve,{width:E}):ae.isMobile&&f(xe,{switchFacingMode:s}),f(V,{"data-testid":"stCameraInputWebcamStyledBox",hidden:g!=="success"&&!r&&!a,width:E,children:!r&&f(We,{audio:!1,ref:C,screenshotFormat:"image/jpeg",screenshotQuality:1,width:E,height:E*9/16,style:{borderRadius:`${i.radii.default} ${i.radii.default} 0 0`},onUserMediaError:()=>{U("error")},onUserMedia:()=>{U("success"),o(!1)},videoConstraints:{width:{ideal:E},facingMode:n}})}),f(q,{onClick:e,disabled:g!=="success"||r||a,children:"Take Photo"})]})},ke=y.memo(Le),je=150,Be=le.getLogger("CameraInput");class Ae extends y.PureComponent{constructor(l){super(l),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new ve,this.getProgress=()=>{if(this.state.files.length>0&&this.state.files[this.state.files.length-1].status.type==="uploading")return this.state.files[this.state.files.length-1].status.progress},this.setClearPhotoInProgress=r=>{this.setState({clearPhotoInProgress:r})},this.setFacingMode=()=>{this.setState(r=>({facingMode:r.facingMode===F.USER?F.ENVIRONMENT:F.USER}))},this.handleCapture=r=>{if(r===null)return Promise.resolve();this.setState({imgSrc:r,shutter:!0,minShutterEffectPassed:!1});const a=o=>new Promise(n=>setTimeout(n,o));return $e(r,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(o=>this.props.uploadClient.fetchFileURLs([o]).then(n=>({file:o,fileUrls:n[0]}))).then(({file:o,fileUrls:n})=>this.uploadFile(n,o)).then(()=>a(je)).then(()=>{this.setState((o,n)=>({imgSrc:r,shutter:o.shutter,minShutterEffectPassed:!0}))}).catch(o=>{Be.error(o)})},this.removeCapture=()=>{this.state.files.length!==0&&(this.state.files.forEach(r=>this.deleteFile(r.id)),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if(this.status!=="ready")return;const r=this.createWidgetValue(),{element:a,widgetMgr:o,fragmentId:n}=this.props,s=o.getFileUploaderStateValue(a);de(r,s)||o.setFileUploaderStateValue(a,r,{fromUi:!0},n)},this.onFormCleared=()=>{this.setState({files:[]},()=>{const r=this.createWidgetValue();if(x(r))return;this.setState({imgSrc:null});const{widgetMgr:a,element:o,fragmentId:n}=this.props;a.setFileUploaderStateValue(o,r,{fromUi:!0},n)})},this.deleteFile=r=>{const a=this.getFile(r);x(a)||(a.status.type==="uploading"&&a.status.cancelToken.cancel(),a.status.type==="uploaded"&&a.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(a.status.fileUrls.deleteUrl),this.removeFile(r))},this.addFile=r=>{this.setState(a=>({files:[...a.files,r]}))},this.removeFile=r=>{this.setState(a=>({files:a.files.filter(o=>o.id!==r)}))},this.getFile=r=>this.state.files.find(a=>a.id===r),this.updateFile=(r,a)=>{this.setState(o=>({files:o.files.map(n=>n.id===r?a:n)}))},this.onUploadComplete=(r,a)=>{this.setState(()=>({shutter:!1}));const o=this.getFile(r);x(o)||o.status.type!=="uploading"||this.updateFile(o.id,o.setStatus({type:"uploaded",fileId:a.fileId,fileUrls:a}))},this.onUploadProgress=(r,a)=>{const o=this.getFile(a);if(x(o)||o.status.type!=="uploading")return;const n=Math.round(r.loaded*100/r.total);o.status.progress!==n&&this.updateFile(a,o.setStatus({type:"uploading",cancelToken:o.status.cancelToken,progress:n}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(r,a)=>{const o=L.CancelToken.source(),n=new k(a.name,a.size,this.nextLocalFileId(),{type:"uploading",cancelToken:o,progress:1});this.addFile(n),this.props.uploadClient.uploadFile(this.props.element,r.uploadUrl,a,s=>this.onUploadProgress(s,n.id),o.token).then(()=>this.onUploadComplete(n.id,r)).catch(s=>{L.isCancel(s)||this.updateFile(n.id,n.setStatus({type:"error",errorMessage:s?s.toString():"Unknown error"}))})},this.state=this.initialValue}get initialValue(){const l={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:F.USER},{widgetMgr:r,element:a}=this.props,o=r.getFileUploaderStateValue(a);if(x(o))return l;const{uploadedFileInfo:n}=o;return x(n)||n.length===0?l:{files:n.map(s=>{const h=s.name,g=s.size,U=s.fileId,C=s.fileUrls;return new k(h,g,this.nextLocalFileId(),{type:"uploaded",fileId:U,fileUrls:C})}),imgSrc:n.length===0?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:F.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){const l=r=>r.status.type==="uploading";return this.state.files.some(l)?"updating":"ready"}componentDidMount(){const l=this.createWidgetValue(),{element:r,widgetMgr:a,fragmentId:o}=this.props;a.getFileUploaderStateValue(r)===void 0&&a.setFileUploaderStateValue(r,l,{fromUi:!1},o)}createWidgetValue(){const l=this.state.files.filter(r=>r.status.type==="uploaded").map(r=>{const{name:a,size:o,status:n}=r;return new ce({fileId:n.fileId,fileUrls:n.fileUrls,name:a,size:o})});return new ue({uploadedFileInfo:l})}render(){var n;const{element:l,widgetMgr:r,disabled:a,width:o}=this.props;return this.formClearHelper.manageFormClearListener(r,l.formId,this.onFormCleared),P(G,{className:"stCameraInput","data-testid":"stCameraInput",children:[f(ge,{label:l.label,disabled:a,labelVisibility:he((n=l.labelVisibility)==null?void 0:n.value),children:l.help&&f(pe,{children:f(fe,{content:l.help,placement:$.TOP_RIGHT})})}),this.state.imgSrc?P(me,{children:[f(V,{width:o,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&f(Me,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:o,height:o*9/16})}),f(q,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||a,children:this.getProgress()?"Uploading...":P(Ue,{children:[f(W,{content:H,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):f(ke,{handleCapture:this.handleCapture,width:o,disabled:a,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}function $e(t,l){return fetch(t).then(r=>r.arrayBuffer()).then(r=>new File([r],l,{type:"image/jpeg"}))}const Ge=se(Ae);export{Ge as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as i,j as c,bo as g,bM as b}from"./index.
|
1
|
+
import{r as i,j as c,bo as g,bM as b}from"./index.PoIwzrI7.js";import{a as m}from"./useBasicWidgetState.DzE2MsN8.js";import"./FormClearHelper.Dd0v0IXt.js";const f=(t,e)=>t.getStringValue(e),p=t=>t.default??null,C=t=>t.value??null,d=(t,e,o,r)=>{e.setStringValue(t,o.value,{fromUi:o.fromUi},r)},S=({element:t,disabled:e,widgetMgr:o,fragmentId:r})=>{var l;const[s,a]=m({getStateFromWidgetMgr:f,getDefaultStateFromProto:p,getCurrStateFromProto:C,updateWidgetMgrState:d,element:t,widgetMgr:o,fragmentId:r}),u=i.useCallback(n=>{a({value:n,fromUi:!0})},[a]);return c(b,{label:t.label,labelVisibility:g((l=t.labelVisibility)==null?void 0:l.value),help:t.help,onChange:u,disabled:e,value:s})},k=i.memo(S);export{k as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as l,a_ as v,J as u,a$ as n,r as b,b0 as s,j as i,b1 as B,b2 as k,b3 as S}from"./index.
|
1
|
+
import{n as l,a_ as v,J as u,a$ as n,r as b,b0 as s,j as i,b1 as B,b2 as k,b3 as S}from"./index.PoIwzrI7.js";function x(o,r){switch(o){case n.XSMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.sm}`,fontSize:r.fontSizes.sm};case n.SMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.md}`};case n.LARGE:return{padding:`${r.spacing.md} ${r.spacing.md}`};default:return{padding:`${r.spacing.xs} ${r.spacing.md}`}}}const e=l("a",{target:"e2m15hl0"})(({containerWidth:o,size:r,theme:a})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:a.fontWeights.normal,padding:`${a.spacing.xs} ${a.spacing.md}`,borderRadius:a.radii.default,minHeight:a.sizes.minElementHeight,margin:0,lineHeight:a.lineHeights.base,color:a.colors.primary,textDecoration:"none",width:o?"100%":"auto",userSelect:"none","&:visited":{color:a.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${u(a.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...x(r,a)})),$=l(e,{target:"e2m15hl1"})(({theme:o})=>({backgroundColor:o.colors.primary,color:o.colors.white,border:`${o.sizes.borderWidth} solid ${o.colors.primary}`,"&:hover":{backgroundColor:v(o.colors.primary,.05),color:o.colors.white},"&:active":{backgroundColor:"transparent",color:o.colors.primary},"&:visited:not(:active)":{color:o.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),L=l(e,{target:"e2m15hl2"})(({theme:o})=>({backgroundColor:o.colors.lightenedBg05,color:o.colors.bodyText,border:`${o.sizes.borderWidth} solid ${o.colors.borderColor}`,"&:visited":{color:o.colors.bodyText},"&:hover":{borderColor:o.colors.primary,color:o.colors.primary},"&:active":{color:o.colors.white,borderColor:o.colors.primary,backgroundColor:o.colors.primary},"&:focus:not(:active)":{borderColor:o.colors.primary,color:o.colors.primary},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),w=l(e,{target:"e2m15hl3"})(({theme:o})=>({padding:o.spacing.none,backgroundColor:o.colors.transparent,color:o.colors.bodyText,border:"none","&:visited":{color:o.colors.bodyText},"&:hover":{color:o.colors.primary},"&:active":{color:o.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{color:o.colors.primary,boxShadow:`0 0 0 0.2rem ${u(o.colors.primary,.5)}`},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}));function T({kind:o,size:r,disabled:a,containerWidth:t,children:c,autoFocus:p,href:g,rel:y,target:f,onClick:C}){let d=$;return o===s.SECONDARY?d=L:o===s.TERTIARY&&(d=w),i(d,{kind:o,size:r||n.MEDIUM,containerWidth:t||!1,disabled:a||!1,autoFocus:p||!1,href:g,target:f,rel:y,onClick:C,tabIndex:a?-1:0,"data-testid":`stBaseLinkButton-${o}`,children:c})}const z=b.memo(T);function R(o){const{element:r}=o;let a=s.SECONDARY;r.type==="primary"?a=s.PRIMARY:r.type==="tertiary"&&(a=s.TERTIARY);const t=c=>{r.disabled&&c.preventDefault()};return i(S,{className:"stLinkButton","data-testid":"stLinkButton",children:i(B,{help:r.help,containerWidth:r.useContainerWidth,children:i(z,{kind:a,size:n.SMALL,disabled:r.disabled,onClick:t,containerWidth:r.useContainerWidth,href:r.url,target:"_blank",rel:"noreferrer","aria-disabled":r.disabled,children:i(k,{icon:r.icon,label:r.label})})})})}const W=b.memo(R);export{W as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as T,r,z as M,b_ as C,b$ as W,C as V,j as n,bo as I,bC as O,bp as $,b5 as L,bq as N,bZ as P,c0 as k,bV as E,c1 as A,bz as B}from"./index.
|
1
|
+
import{n as T,r,z as M,b_ as C,b$ as W,C as V,j as n,bo as I,bC as O,bp as $,b5 as L,bq as N,bZ as P,c0 as k,bV as E,c1 as A,bz as B}from"./index.PoIwzrI7.js";import{a as F}from"./useBasicWidgetState.DzE2MsN8.js";import"./FormClearHelper.Dd0v0IXt.js";const H=T("div",{target:"euzcfsp0"})(({theme:s})=>({"span[aria-disabled='true']":{background:s.colors.fadedText05}})),D=(s,t)=>s.getStringArrayValue(t),U=s=>s.default.map(t=>s.options[t])??null,j=s=>s.rawValues??null,G=(s,t,a,p)=>{t.setStringArrayValue(s,a.value,{fromUi:a.fromUi},p)},K=s=>{var S;const{element:t,widgetMgr:a,fragmentId:p}=s,e=M(),[i,m]=F({getStateFromWidgetMgr:D,getDefaultStateFromProto:U,getCurrStateFromProto:j,updateWidgetMgrState:G,element:t,widgetMgr:a,fragmentId:p}),h=t.maxSelections>0&&i.length>=t.maxSelections,f=r.useMemo(()=>{if(t.maxSelections===0)return"No results";if(i.length===t.maxSelections){const o=t.maxSelections!==1?"options":"option";return`You can only select up to ${t.maxSelections} ${o}. Remove an option first.`}return"No results"},[t.maxSelections,i.length]),y=r.useMemo(()=>i.map(o=>({value:o,label:o})),[i]),b=r.useCallback(o=>{var l,d;switch(o.type){case"remove":return C(i,(l=o.option)==null?void 0:l.value);case"clear":return[];case"select":return i.concat([(d=o.option)==null?void 0:d.value]);default:throw new Error(`State transition is unknown: ${o.type}`)}},[i]),v=r.useCallback(o=>{t.maxSelections&&o.type==="select"&&i.length>=t.maxSelections||m({value:b(o),fromUi:!0})},[t.maxSelections,b,m,i.length]),x=r.useCallback((o,l)=>{if(h)return[];const d=o.filter(R=>!i.includes(R.value));return W(d,l)},[h,i]),{options:u}=t;let c=s.disabled,g=t.placeholder;u.length===0&&(t.acceptNewOptions?g="Add options":(g="No options to select",c=!0));const z=u.map((o,l)=>({label:o,value:o,id:`${o}_${l}`})),w=u.length>10;return V("div",{className:"stMultiSelect","data-testid":"stMultiSelect",children:[n(N,{label:t.label,disabled:c,labelVisibility:I((S=t.labelVisibility)==null?void 0:S.value),children:t.help&&n(O,{children:n($,{content:t.help,placement:L.TOP_RIGHT})})}),n(H,{children:n(P,{creatable:t.acceptNewOptions??!1,options:z,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:g,type:A.select,multi:!0,onChange:v,value:y,disabled:c,size:"compact",noResultsMsg:f,filterOptions:x,closeOnSelect:!1,ignoreCase:!1,overrides:{Popover:{props:{overrides:{Body:{style:()=>({marginTop:e.spacing.px})}}}},SelectArrow:{component:E,props:{overrides:{Svg:{style:()=>({width:e.iconSizes.xl,height:e.iconSizes.xl})}}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ControlContainer:{style:{minHeight:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}},Placeholder:{style:()=>({flex:"inherit",color:c?e.colors.fadedText40:e.colors.fadedText60})},ValueContainer:{style:()=>({paddingLeft:e.spacing.sm,paddingTop:e.spacing.none,paddingBottom:e.spacing.none,paddingRight:e.spacing.none})},ClearIcon:{props:{overrides:{Svg:{style:{color:e.colors.darkGray,padding:e.spacing.threeXS,height:e.sizes.clearIconSize,width:e.sizes.clearIconSize,cursor:"pointer",":hover":{fill:e.colors.bodyText}}}}}},SearchIcon:{style:{color:e.colors.darkGray}},Tag:{props:{overrides:{Root:{style:{borderTopLeftRadius:e.radii.md,borderTopRightRadius:e.radii.md,borderBottomRightRadius:e.radii.md,borderBottomLeftRadius:e.radii.md,fontSize:e.fontSizes.md,paddingLeft:e.spacing.sm,marginLeft:e.spacing.none,marginRight:e.spacing.sm,height:`calc(${e.sizes.minElementHeight} - 2 * ${e.spacing.xs})`,maxWidth:`calc(100% - ${e.spacing.lg})`,cursor:"default !important"}},Action:{style:{paddingLeft:0}},ActionIcon:{props:{overrides:{Svg:{style:{width:"0.625em",height:"0.625em"}}}}}}}},MultiValue:{props:{overrides:{Root:{style:{fontSize:e.fontSizes.sm}}}}},Input:{props:{readOnly:B.isMobile&&w===!1?"readonly":null}},Dropdown:{component:k}}})})]})},X=r.memo(K);export{X as default};
|