playbook_ui 13.34.1.pre.alpha.PLAY14043436 → 13.34.1.pre.alpha.PLAY14633399
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +1 -3
- data/app/pb_kits/playbook/pb_dialog/dialog.test.jsx +1 -20
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_default.jsx +5 -1
- data/app/pb_kits/playbook/pb_dialog/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_dialog/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_table/_table.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/index.ts +4 -4
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_body.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_cell.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_head.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_header.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/table.test.js +2 -0
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +1 -1
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +45 -27
- data/app/pb_kits/playbook/pb_textarea/index.ts +3 -3
- data/app/pb_kits/playbook/pb_time/_time.tsx +3 -3
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +1 -1
- data/app/pb_kits/playbook/pb_timeline/_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +1 -1
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +10 -10
- data/app/pb_kits/playbook/pb_toggle/_toggle.tsx +1 -1
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +2 -2
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +1 -2
- data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +2 -0
- data/app/pb_kits/playbook/pb_user/_user.tsx +1 -1
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.tsx +6 -6
- data/app/pb_kits/playbook/pb_user_badge/badges/million-dollar.tsx +236 -235
- data/app/pb_kits/playbook/pb_user_badge/badges/veteran.tsx +1 -1
- data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +68 -63
- data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +1 -1
- data/dist/chunks/{_typeahead-BUOMinLQ.js → _typeahead-Clhh5t_H.js} +2 -2
- data/dist/chunks/{_weekday_stacked-wqYpGCEo.js → _weekday_stacked-C1tp5PyP.js} +2 -2
- data/dist/chunks/{lib-Bf_E03gc.js → lib-BE0Z3F7x.js} +1 -1
- data/dist/chunks/{pb_form_validation-D0dhqeN2.js → pb_form_validation-TzZQ0Flx.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +6 -7
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.jsx +0 -46
@@ -1,4 +1,4 @@
|
|
1
|
-
import{r as requireLazysizes}from"./lazysizes-B7xYodB-.js";import{jsx,Fragment,jsxs}from"react/jsx-runtime";import*as React from"react";import React__default,{useEffect,createContext,useContext,useState,useCallback,createElement,useRef,forwardRef,useImperativeHandle,Fragment as Fragment$1,useReducer,useMemo,useLayoutEffect,isValidElement}from"react";import{h as buildAriaProps,i as buildDataProps,j as buildHtmlProps,k as classnames,l as globalProps,m as buildCss,F as Flex,I as Icon,n as FlexItem,o as Body$1,p as Caption,A as Avatar,q as domSafeProps,r as Title,S as SectionSeparator,s as Draggable,t as TextInput,u as PropTypes,v as Card,w as noop$2,x as PbReactPopover,y as CircleIconButton,z as Button,E as Badge,H as joinPresent,J as titleize,K as IconCircle,N as Image,O as Checkbox,Q as Radio,U as ExecutionEnvironment}from"./_typeahead-
|
1
|
+
import{r as requireLazysizes}from"./lazysizes-B7xYodB-.js";import{jsx,Fragment,jsxs}from"react/jsx-runtime";import*as React from"react";import React__default,{useEffect,createContext,useContext,useState,useCallback,createElement,useRef,forwardRef,useImperativeHandle,Fragment as Fragment$1,useReducer,useMemo,useLayoutEffect,isValidElement}from"react";import{h as buildAriaProps,i as buildDataProps,j as buildHtmlProps,k as classnames,l as globalProps,m as buildCss,F as Flex,I as Icon,n as FlexItem,o as Body$1,p as Caption,A as Avatar,q as domSafeProps,r as Title,S as SectionSeparator,s as Draggable,t as TextInput,u as PropTypes,v as Card,w as noop$2,x as PbReactPopover,y as CircleIconButton,z as Button,E as Badge,H as joinPresent,J as titleize,K as IconCircle,N as Image,O as Checkbox,Q as Radio,U as ExecutionEnvironment}from"./_typeahead-Clhh5t_H.js";import{g as PbTable,D as DateTime$1,a as datePickerHelper,u as useDropdown,o as omitBy,i as isEmpty,m as map,p as partial,j as find$1,n as noop$3,k as colors,h as PbTextarea,l as getDefaultExportFromCjs,q as commonjsGlobal}from"./lib-BE0Z3F7x.js";import ReactDOM__default,{createPortal}from"react-dom";import{isValidElementType,Element,ForwardRef,typeOf}from"react-is";var ls_attrchange={exports:{}};(function(module){(function(window2,factory){if(!window2){return}var globalInstall=function(){factory(window2.lazySizes);window2.removeEventListener("lazyunveilread",globalInstall,true)};factory=factory.bind(null,window2,window2.document);if(module.exports){factory(requireLazysizes())}else if(window2.lazySizes){globalInstall()}else{window2.addEventListener("lazyunveilread",globalInstall,true)}})(typeof window!="undefined"?window:0,(function(window2,document2,lazySizes){var addObserver=function(){var connect,disconnect,observer,connected;var lsCfg=lazySizes.cfg;var attributes={"data-bgset":1,"data-include":1,"data-poster":1,"data-bg":1,"data-script":1};var regClassTest="(\\s|^)("+lsCfg.loadedClass;var docElem=document2.documentElement;var setClass=function(target){lazySizes.rAF((function(){lazySizes.rC(target,lsCfg.loadedClass);if(lsCfg.unloadedClass){lazySizes.rC(target,lsCfg.unloadedClass)}lazySizes.aC(target,lsCfg.lazyClass);if(target.style.display=="none"||target.parentNode&&target.parentNode.style.display=="none"){setTimeout((function(){lazySizes.loader.unveil(target)}),0)}}))};var onMutation=function(mutations){var i,len,mutation,target;for(i=0,len=mutations.length;i<len;i++){mutation=mutations[i];target=mutation.target;if(!target.getAttribute(mutation.attributeName)){continue}if(target.localName=="source"&&target.parentNode){target=target.parentNode.querySelector("img")}if(target&®ClassTest.test(target.className)){setClass(target)}}};if(lsCfg.unloadedClass){regClassTest+="|"+lsCfg.unloadedClass}regClassTest+="|"+lsCfg.loadingClass+")(\\s|$)";regClassTest=new RegExp(regClassTest);attributes[lsCfg.srcAttr]=1;attributes[lsCfg.srcsetAttr]=1;if(window2.MutationObserver){observer=new MutationObserver(onMutation);connect=function(){if(!connected){connected=true;observer.observe(docElem,{subtree:true,attributes:true,attributeFilter:Object.keys(attributes)})}};disconnect=function(){if(connected){connected=false;observer.disconnect()}}}else{docElem.addEventListener("DOMAttrModified",function(){var runs;var modifications=[];var callMutations=function(){onMutation(modifications);modifications=[];runs=false};return function(e){if(connected&&attributes[e.attrName]&&e.newValue){modifications.push({target:e.target,attributeName:e.attrName});if(!runs){setTimeout(callMutations);runs=true}}}}(),true);connect=function(){connected=true};disconnect=function(){connected=false}}addEventListener("lazybeforeunveil",disconnect,true);addEventListener("lazybeforeunveil",connect);addEventListener("lazybeforesizes",disconnect,true);addEventListener("lazybeforesizes",connect);connect();removeEventListener("lazybeforeunveil",addObserver)};addEventListener("lazybeforeunveil",addObserver)}))})(ls_attrchange);
|
2
2
|
/**
|
3
3
|
* table-core
|
4
4
|
*
|
@@ -18,7 +18,7 @@ import{r as requireLazysizes}from"./lazysizes-B7xYodB-.js";import{jsx,Fragment,j
|
|
18
18
|
* LICENSE.md file in the root directory of this source tree.
|
19
19
|
*
|
20
20
|
* @license MIT
|
21
|
-
*/function flexRender(Comp,props){return!Comp?null:isReactComponent(Comp)?React.createElement(Comp,props):Comp}function isReactComponent(component){return isClassComponent(component)||typeof component==="function"||isExoticComponent(component)}function isClassComponent(component){return typeof component==="function"&&(()=>{const proto=Object.getPrototypeOf(component);return proto.prototype&&proto.prototype.isReactComponent})()}function isExoticComponent(component){return typeof component==="object"&&typeof component.$$typeof==="symbol"&&["react.memo","react.forward_ref"].includes(component.$$typeof.description)}function useReactTable(options){const resolvedOptions={state:{},onStateChange:()=>{},renderFallbackValue:null,...options};const[tableRef]=React.useState((()=>({current:createTable(resolvedOptions)})));const[state,setState]=React.useState((()=>tableRef.current.initialState));tableRef.current.setOptions((prev=>({...prev,...options,state:{...state,...options.state},onStateChange:updater=>{setState(updater);options.onStateChange==null?void 0:options.onStateChange(updater)}})));return tableRef.current}const TableHead=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,tag:tag="table"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames("pb_table_thead",globalProps(props),className);const isTableTag=tag==="table";return jsx(Fragment,{children:isTableTag?jsx("thead",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children})})};const TableHeader$1=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,tag:tag="table",text:text2}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames("pb_table_th",globalProps(props),className);const isTableTag=tag==="table";return jsx(Fragment,{children:isTableTag?jsx("th",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:text2||children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:text2||children})})};const TableBody$1=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,tag:tag="table"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames("pb_table_tbody",globalProps(props),className);const isTableTag=tag==="table";return jsx(Fragment,{children:isTableTag?jsx("tbody",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children})})};const TableRow=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,sideHighlightColor:sideHighlightColor="none",tag:tag="table"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const sideHighlightClass=sideHighlightColor!=""?`side_highlight_${sideHighlightColor}`:null;const classes=classnames(buildCss("pb_table_row_kit",sideHighlightClass),"pb_table_tr",globalProps(props),className);const isTableTag=tag==="table";return jsx(Fragment,{children:isTableTag?jsx("tr",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children})})};const TableCell=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,tag:tag="table",text:text2}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames("pb_table_td",globalProps(props),className);const isTableTag=tag==="table";return jsx(Fragment,{children:isTableTag?jsx("td",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:text2||children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:text2||children})})};const Table=props=>{const{aria:aria={},children:children,className:className,collapse:collapse="sm",container:container=true,dark:dark,data:data={},dataTable:dataTable=false,disableHover:disableHover=false,htmlOptions:htmlOptions={},id:id,outerPadding:outerPadding="",responsive:responsive="collapse",singleLine:singleLine=false,size:size="sm",sticky:sticky=false,striped:striped=false,tag:tag="table",verticalBorder:verticalBorder=false}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const tableCollapseCss=responsive!=="none"?`table-collapse-${collapse}`:"";const verticalBorderCss=verticalBorder?"vertical-border":"";const spaceCssName=outerPadding!=="none"?"space_":"";const outerPaddingCss=outerPadding?`outer_padding_${spaceCssName}${outerPadding}`:"";const isTableTag=tag==="table";const classNames=classnames("pb_table",`table-${size}`,`table-responsive-${responsive}`,{"table-card":container,"table-dark":dark,data_table:dataTable,"single-line":singleLine,"no-hover":disableHover,"sticky-header":sticky,striped:striped,[outerPaddingCss]:outerPadding!==""},globalProps(props),tableCollapseCss,verticalBorderCss,className);useEffect((()=>{const instance=new PbTable;instance.connect()}),[]);return jsx(Fragment,{children:isTableTag?jsx("table",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,children:children})})};Table.Head=TableHead;Table.Header=TableHeader$1;Table.Body=TableBody$1;Table.Row=TableRow;Table.Cell=TableCell;const AdvancedTableContext=createContext({});const filterExpandableRows=expandedState=>{for(const expandedRow in expandedState){if(expandedState[expandedRow]===false){delete expandedState[expandedRow]}}return expandedState};const updateExpandAndCollapseState=(tableRows,expanded,targetParent)=>{const updateExpandedRows={};const rows=tableRows.rows;let isExpansionConsistent=true;const areRowsExpanded=new Set;for(const row of rows){const shouldBeUpdated=targetParent===void 0?row.depth===0:targetParent===row.parentId;if(shouldBeUpdated){const isExpanded=row.getIsExpanded();areRowsExpanded.add(isExpanded);updateExpandedRows[row.id]=!isExpansionConsistent?true:!isExpanded;if(areRowsExpanded.size>1){isExpansionConsistent=false;for(const key in updateExpandedRows){updateExpandedRows[key]=true}}}}return filterExpandableRows({...expanded,...updateExpandedRows})};const CustomCell=({getValue:getValue,onRowToggleClick:onRowToggleClick,row:row,value:value})=>{const{setExpanded:setExpanded,expanded:expanded,expandedControl:expandedControl,inlineRowLoading:inlineRowLoading}=useContext(AdvancedTableContext);const handleOnExpand=row2=>{onRowToggleClick&&onRowToggleClick(row2);if(!expandedControl){setExpanded({...expanded,[row2.id]:!row2.getIsExpanded()})}};const RowHasChildren=row.original.children?true:false;const renderButton=inlineRowLoading?RowHasChildren:row.getCanExpand();return jsx("div",{style:{paddingLeft:`${row.depth*1.25}em`},children:jsxs(Flex,{alignItems:"center",columnGap:"xs",orientation:"row",children:[renderButton?jsx("button",{className:"gray-icon expand-toggle-icon",onClick:()=>handleOnExpand(row),children:row.getIsExpanded()?jsx(Icon,{cursor:"pointer",icon:"circle-play",rotation:90}):jsx(Icon,{cursor:"pointer",icon:"circle-play"})}):null,jsx(FlexItem,{paddingLeft:renderButton?"none":"xs",children:row.depth===0?getValue():value})]})})};const displayIcon=icon=>{if(typeof icon==="string"){return[icon,icon]}return icon};const SortIconButton=({header:header,sortIcon:sortIcon})=>jsx(Fragment,{children:header.column.getIsSorted()==="desc"?jsx("div",{className:"sort-button-icon",children:jsx(Icon,{icon:displayIcon(sortIcon)[0]})},displayIcon(sortIcon)[0]):jsx("div",{className:"sort-button-icon",children:jsx(Icon,{icon:displayIcon(sortIcon)[1]})},displayIcon(sortIcon)[1])});const ToggleIconButton=({row:row,onClick:onClick})=>{const{toggleExpansionIcon:toggleExpansionIcon}=useContext(AdvancedTableContext);return jsx("button",{className:"gray-icon toggle-all-icon",onClick:()=>onClick(row),children:jsx(Icon,{cursor:"pointer",fixedWidth:true,icon:displayIcon(toggleExpansionIcon)[0]})},displayIcon(toggleExpansionIcon)[0])};const isChrome=()=>{const userAgent=navigator.userAgent.toLowerCase();return userAgent.includes("chrome")&&!userAgent.includes("edg")};const TableHeaderCell=({enableSorting:enableSorting,enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,header:header,headerChildren:headerChildren,loading:loading,sortIcon:sortIcon})=>{const{sortControl:sortControl}=useContext(AdvancedTableContext);const toggleSortButton=event=>{if(sortControl){const sortIsDesc=header.column.getIsSorted()==="desc";sortIsDesc?sortControl.onChange({desc:true}):sortControl.onChange({desc:false})}else{header.column.getToggleSortingHandler()(event)}};const cellClassName=classnames("table-header-cells",`${isChrome()?"chrome-styles":""}`,`${enableSorting?"table-header-cells-active":""}`);const cellId=`${loading?`loading-${header.id}`:`${header.id}`}`;const isToggleExpansionEnabledLoading=header.index===0&&loading&&(enableToggleExpansion==="all"||"header")&&enableToggleExpansion!=="none";const isToggleExpansionEnabled=header.index===0&&!loading&&(enableToggleExpansion==="all"||"header")&&enableToggleExpansion!=="none";return jsx("th",{align:"right",className:cellClassName,id:cellId,children:header.isPlaceholder?null:headerChildren&&header.index===0?jsxs(Flex,{alignItems:"center",children:[headerChildren,jsx("div",{children:flexRender(header.column.columnDef.header,header.getContext())})]}):jsxs(Flex,{alignItems:"center",justify:header.index===0&&enableSorting?"between":header.index===0&&!enableSorting?"start":"end",children:[isToggleExpansionEnabled&&jsx(ToggleIconButton,{onClick:handleExpandOrCollapse}),isToggleExpansionEnabledLoading&&jsx("div",{className:"loading-toggle-icon header-toggle-icon"}),jsxs(Flex,{className:`${header.index===0&&enableSorting&&"header-sort-button pb_th_link"}`,cursor:header.index===0&&enableSorting?"pointer":"default",...header.index===0&&enableSorting&&{htmlOptions:{onClick:event=>toggleSortButton(event),onKeyDown:event=>{if(event.key==="Enter"){toggleSortButton(event)}},tabIndex:0}},justify:header.index===0&&enableSorting?"between":"none",paddingLeft:enableSorting?"xxs":"xs",children:[jsx("div",{children:flexRender(header.column.columnDef.header,header.getContext())}),header.index===0&&header.column.getCanSort()&&enableSorting&&(loading?jsx("div",{className:"loading-toggle-icon"}):jsx(SortIconButton,{header:header,sortIcon:sortIcon}))]})]})},`${header.id}-header`)};const TableHeader=({children:children,className:className,dark:dark=false,enableSorting:enableSorting=false,id:id,sortIcon:sortIcon=["arrow-up-short-wide","arrow-down-short-wide"],...props})=>{const{enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,loading:loading,table:table}=useContext(AdvancedTableContext);const classes=classnames(buildCss("pb_advanced_table_header"),globalProps(props),className);return jsx(Fragment,{children:jsx("thead",{className:classes,id:id,children:table.getHeaderGroups().map((headerGroup=>jsx("tr",{children:headerGroup.headers.map((header=>jsx(TableHeaderCell,{enableSorting:enableSorting,enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,header:header,headerChildren:children,loading:loading,sortIcon:sortIcon},`${header.id}-header`)))},`${headerGroup.id}-headerGroup`)))})})};const LoadingInline=props=>{const{align:align="left",aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,text:text2=" Loading"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss(`pb_loading_inline_kit_${align}`),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs(Body$1,{color:"light",children:[jsx(Icon,{aria:{label:"loading icon"},fixedWidth:true,icon:"spinner",pulse:true}),text2]})})};const CollapsibleTrail=({leftOffset:leftOffset})=>{const style={position:"absolute",left:`${leftOffset}em`,top:0,bottom:0,width:"2px",backgroundColor:"#E4E8F0"};return jsx("div",{className:"collapsible-trail",style:style})};const renderCollapsibleTrail=currentDepth=>{const lines=[];for(let i=1;i<=currentDepth;i++){const additionalOffset=i>1?(i-1)*.25:0;const leftOffset=i*1+additionalOffset;lines.push(jsx(CollapsibleTrail,{leftOffset:leftOffset},i))}return lines};const SubRowHeaderRow=({collapsibleTrail:collapsibleTrail,enableToggleExpansion:enableToggleExpansion,onClick:onClick,row:row,subRowHeaders:subRowHeaders,table:table})=>{const{inlineRowLoading:inlineRowLoading}=useContext(AdvancedTableContext);const numberOfColumns=table.getAllFlatColumns().length;const rowHasChildren=row.original.children?true:false;const canExpand=inlineRowLoading?rowHasChildren:row.getCanExpand();return jsxs("tr",{className:"custom-row bg-silver",children:[jsxs("td",{className:`custom-row-first-column ${isChrome()?"chrome-styles":""}`,colSpan:1,children:[collapsibleTrail&&row.depth>0&&renderCollapsibleTrail(row.depth),jsx("div",{style:{paddingLeft:`${row.depth*1.25}em`},children:jsxs(Flex,{align:"center",columnGap:"xs",children:[enableToggleExpansion==="all"&&canExpand?jsx(ToggleIconButton,{onClick:onClick,row:row}):null,jsx(Caption,{marginLeft:canExpand?"none":"xs",text:subRowHeaders[row.depth-1]})]})})]}),jsx("td",{colSpan:numberOfColumns-1})]})};const LoadingCell=()=>jsx("div",{className:"loading-cell"});const TableBody=({className:className,collapsibleTrail:collapsibleTrail=true,dark:dark=false,id:id,subRowHeaders:subRowHeaders,...props})=>{const{columnDefinitions:columnDefinitions,enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,inlineRowLoading:inlineRowLoading,loading:loading,table:table}=useContext(AdvancedTableContext);const classes=classnames(buildCss("pb_advanced_table_body"),globalProps(props),className);return jsx(Fragment,{children:jsx("tbody",{className:classes,id:id,children:table.getRowModel().rows.map((row=>{var _a;const isExpandable=row.getIsExpanded();const isFirstChildofSubrow=row.depth>0&&row.index===0;const rowHasNoChildren=row.original.children&&!row.original.children.length?true:false;const numberOfColumns=table.getAllFlatColumns().length;const isDataLoading=isExpandable&&(inlineRowLoading&&rowHasNoChildren)&&row.depth<((_a=columnDefinitions[0].cellAccessors)==null?void 0:_a.length);const rowBackground=isExpandable&&(!inlineRowLoading&&row.getCanExpand()||inlineRowLoading&&rowHasNoChildren);return jsxs(React__default.Fragment,{children:[isFirstChildofSubrow&&subRowHeaders&&jsx(SubRowHeaderRow,{collapsibleTrail:collapsibleTrail,enableToggleExpansion:enableToggleExpansion,onClick:handleExpandOrCollapse,row:row,subRowHeaders:subRowHeaders,table:table}),jsx("tr",{className:`${rowBackground?"bg-silver":"bg-white"} ${row.depth>0?`depth-sub-row-${row.depth}`:""}`,id:`${row.index}-${row.id}-${row.depth}-row`,children:row.getVisibleCells().map(((cell,i)=>jsxs("td",{align:"right",className:`${cell.id}-cell position_relative ${isChrome()?"chrome-styles":""}`,children:[collapsibleTrail&&i===0&&row.depth>0&&renderCollapsibleTrail(row.depth),jsx("span",{id:`${cell.id}-span`,children:loading?jsx(LoadingCell,{}):flexRender(cell.column.columnDef.cell,cell.getContext())})]},`${cell.id}-data`)))}),isDataLoading?jsx("tr",{children:jsx("td",{colSpan:numberOfColumns,style:{paddingLeft:`${row.depth===0?.5:row.depth*2}em`},children:jsx(LoadingInline,{})})},`${row.id}-row`):null]},`${row.index}-${row.id}-${row.depth}-row`)}))})})};const AdvancedTable=props=>{const{aria:aria={},children:children,className:className,columnDefinitions:columnDefinitions,dark:dark=false,data:data={},enableToggleExpansion:enableToggleExpansion="header",expandedControl:expandedControl,htmlOptions:htmlOptions={},id:id,initialLoadingRowsCount:initialLoadingRowsCount=10,inlineRowLoading:inlineRowLoading=false,loading:loading,onRowToggleClick:onRowToggleClick,onToggleExpansionClick:onToggleExpansionClick,sortControl:sortControl,tableData:tableData,tableOptions:tableOptions,tableProps:tableProps,toggleExpansionIcon:toggleExpansionIcon="arrows-from-line"}=props;const[loadingStateRowCount,setLoadingStateRowCount]=useState(initialLoadingRowsCount);const[localExpanded,setLocalExpanded]=useState({});const expanded=expandedControl?expandedControl.value:localExpanded;const setExpanded=expandedControl?expandedControl.onChange:setLocalExpanded;const columnHelper=createColumnHelper();const createCellFunction=cellAccessors=>{const columnCells=({row:row,getValue:getValue})=>{const rowData=row.original;switch(row.depth){case 0:{return jsx(CustomCell,{getValue:getValue,onRowToggleClick:onRowToggleClick,row:row})}default:{const depthAccessor=cellAccessors[row.depth-1];const accessorValue=rowData[depthAccessor];return accessorValue?jsx(CustomCell,{onRowToggleClick:onRowToggleClick,row:row,value:accessorValue}):"N/A"}}};return columnCells};const columns=columnDefinitions&&columnDefinitions.map((column=>{const columnStructure={...columnHelper.accessor(column.accessor,{header:column.label})};if(column.cellAccessors){columnStructure.cell=createCellFunction(column.cellAccessors)}return columnStructure}));const sorting=[{id:columnDefinitions[0].accessor,desc:sortControl&&sortControl.value!==null?!sortControl.value.desc:false}];const expandAndSortState=()=>{if(sortControl){return{state:{expanded:expanded,sorting:sorting}}}else{return{state:{expanded:expanded}}}};const table=useReactTable({data:loading?Array(loadingStateRowCount).fill({}):tableData,columns:columns,onExpandedChange:setExpanded,getSubRows:row=>row.children,getCoreRowModel:getCoreRowModel(),getExpandedRowModel:getExpandedRowModel(),getSortedRowModel:getSortedRowModel(),enableSortingRemoval:false,sortDescFirst:true,...expandAndSortState(),...tableOptions});const tableRows=table.getRowModel();const updateLoadingStateRowCount=useCallback((()=>{const rowsCount=table.getRowModel().rows.length;if(rowsCount!==loadingStateRowCount&&rowsCount!==0){setLoadingStateRowCount(rowsCount)}}),[tableData,loadingStateRowCount]);useEffect((()=>{if(!loading){updateLoadingStateRowCount()}}),[loading,updateLoadingStateRowCount]);const handleExpandOrCollapse=async row=>{onToggleExpansionClick&&onToggleExpansionClick(row);const expandedState=expanded;const targetParent=row==null?void 0:row.parentId;const updatedRows=await updateExpandAndCollapseState(tableRows,expandedState,targetParent);setExpanded(updatedRows)};const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_advanced_table"),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsx(AdvancedTableContext.Provider,{value:{columnDefinitions:columnDefinitions,enableToggleExpansion:enableToggleExpansion,expanded:expanded,expandedControl:expandedControl,handleExpandOrCollapse:handleExpandOrCollapse,inlineRowLoading:inlineRowLoading,loading:loading,setExpanded:setExpanded,sortControl:sortControl,table:table,toggleExpansionIcon:toggleExpansionIcon},children:jsx(Table,{className:`${loading?"content-loading":""}`,dark:dark,dataTable:true,numberSpacing:"tabular",responsive:"none",...tableProps,children:children?children:jsxs(Fragment,{children:[jsx(TableHeader,{}),jsx(TableBody,{})]})})})})};AdvancedTable.Header=TableHeader;AdvancedTable.Body=TableBody;const AvatarActionButton=props=>{const{action:action="add",aria:aria={},linkAriaLabel:linkAriaLabel,className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},id:id,imageAlt:imageAlt="",imageUrl:imageUrl,linkUrl:linkUrl,name:name,onClick:onClick,placement:placement="bottom left",size:size="md"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_avatar_action_button_kit",action,placement,size),globalProps(props),className);const icons={add:"plus-circle",remove:"times-circle"};return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs("a",{"aria-label":linkAriaLabel,href:linkUrl,onClick:onClick,children:[jsx(Avatar,{imageAlt:imageAlt,imageUrl:imageUrl,name:name,size:size}),jsx("div",{className:`icon ${dark?"dark":""}`,children:jsx(Icon,{dark:dark,icon:icons[action]})})]})})};const BreadCrumbItem=props=>{const{aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,component:component="a",...rest}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const Component=component||"span";const css=classnames(buildCss("pb_bread_crumb_item_kit"),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:css,id:id,children:jsx(Component,{className:"pb_bread_crumb_item",...domSafeProps(rest)})})};const BreadCrumbs=props=>{const{aria:aria={label:"Breadcrumb Navigation"},className:className,data:data={},htmlOptions:htmlOptions={},id:id,children:children}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const css=classnames(buildCss("pb_bread_crumbs_kit"),globalProps(props),className);return jsx("nav",{...ariaProps,...dataProps,...htmlProps,className:css,id:id,children:children})};const ButtonToolbar=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,orientation:orientation="horizontal",text:text2,variant:variant="primary"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_button_toolbar_kit",orientation,variant),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children||text2})};const contactTypeMap={cell:"mobile",email:"envelope",extension:"phone-plus",home:"phone",work:"phone-office","work-cell":"phone-laptop","wrong-phone":"phone-slash"};const formatContact=(contactString,contactType)=>{if(contactType==="email")return contactString;const cleaned=contactString.replace(/\D/g,"");const phoneNumber=cleaned.match(/^(1|)?(\d{3})(\d{3})(\d{4})$/);if(contactType==="extension"){return cleaned.match(/^\d{4}$/)}if(phoneNumber){const intlCode=phoneNumber[1]?"+1 ":"";return[intlCode,"(",phoneNumber[2],") ",phoneNumber[3],"-",phoneNumber[4]].join("")}return null};const Contact=props=>{const{aria:aria={},className:className,contactDetail:contactDetail,contactType:contactType,contactValue:contactValue,data:data={},dark:dark=false,htmlOptions:htmlOptions={},id:id}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_contact_kit"),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs(Body$1,{className:"pb_contact_kit",color:"light",dark:dark,tag:"span",children:[jsx(Icon,{dark:dark,fixedWidth:true,icon:contactTypeMap[contactType]||"phone"}),` ${formatContact(contactValue,contactType)} `,contactDetail&&jsx(Caption,{dark:dark,size:"xs",tag:"span",text:contactDetail})]})})};const sizes$1={lg:1,md:3,sm:4};const Currency=props=>{const{abbreviate:abbreviate=false,align:align="left",aria:aria={},amount:amount,data:data={},decimals:decimals="default",emphasized:emphasized=true,htmlOptions:htmlOptions={},id:id,unit:unit,className:className,label:label="",size:size="sm",symbol:symbol="$",variant:variant="default",dark:dark=false,unstyled:unstyled=false}=props;const emphasizedClass=emphasized?"":"_deemphasized";let variantClass;if(variant==="light"){variantClass="_light"}else if(variant==="bold"){variantClass="_bold"}const[whole,decimal="00"]=amount.split(".");const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_currency_kit",align,size),globalProps(props),className);const getFormattedNumber=input=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(input);const getAbbreviatedValue=abbrType=>{const num=`${getFormattedNumber(whole.split(",").join(""))}`,isAmount=abbrType==="amount",isUnit=abbrType==="unit";return isAmount?num.slice(0,-1):isUnit?num.slice(-1):""};const getMatchingDecimalAmount=decimals==="matching"?amount:whole,getMatchingDecimalValue=decimals==="matching"?"":`.${decimal}`;const getAmount=abbreviate?getAbbreviatedValue("amount"):getMatchingDecimalAmount,getAbbreviation=abbreviate?getAbbreviatedValue("unit"):null,getDecimalValue=abbreviate?"":getMatchingDecimalValue;return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[jsx(Caption,{dark:dark,children:label}),jsx("div",{className:`pb_currency_wrapper${variantClass||emphasizedClass}`,children:unstyled?jsxs(Fragment,{children:[jsx("div",{children:symbol}),jsx("div",{children:getAmount}),jsxs("div",{children:[getAbbreviation,unit?unit:getDecimalValue]})]}):jsxs(Fragment,{children:[jsx(Body$1,{className:"dollar_sign",color:"light",dark:dark,children:symbol}),jsx(Title,{className:"pb_currency_value",dark:dark,size:sizes$1[size],children:getAmount}),jsxs(Body$1,{className:"unit",color:"light",dark:dark,children:[getAbbreviation,unit?unit:getDecimalValue]})]})})]})};const statusMap={increase:"positive",decrease:"negative",neutral:"neutral"};const iconMap$1={increase:"arrow-up",decrease:"arrow-down"};const StatChange=props=>{const{change:change="neutral",className:className,htmlOptions:htmlOptions={},icon:icon,id:id,value:value}=props;const status=statusMap[change];let returnedIcon=iconMap$1[change];if(icon){returnedIcon=icon}const htmlProps=buildHtmlProps(htmlOptions);return jsx(Fragment,{children:value&&jsx("div",{className:classnames(buildCss("pb_stat_change_kit",status),globalProps(props),className),id:id,...htmlProps,children:jsxs(Body$1,{status:status,children:[returnedIcon&&jsxs(Fragment,{children:[jsx(Icon,{fixed_width:true,icon:returnedIcon})," "]}),`${value}%`]})})})};const StatValue=props=>{const{className:className,htmlOptions:htmlOptions={},id:id,unit:unit,value:value=0}=props;const htmlProps=buildHtmlProps(htmlOptions);const displayValue=function(value2){if(value2||value2===0){return jsx(Title,{size:1,tag:"span",text:`${value2}`})}};const displayUnit=function(unit2){if(unit2){return jsx(Title,{size:3,tag:"span",text:unit2})}};return jsx("div",{className:classnames("pb_stat_value_kit",globalProps(props),className),id:id,...htmlProps,children:jsxs("div",{className:"pb_stat_value_wrapper",children:[displayValue(value)," ",displayUnit(unit)]})})};const DashboardValue=props=>{const{align:align="left",aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,statChange:statChange={},statLabel:statLabel,statValue:statValue={}}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_dashboard_value_kit",align),globalProps(props),className);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[statLabel&&jsx(Body$1,{color:"light",children:statLabel}),statValue&&jsx(StatValue,{unit:statValue.unit,value:statValue.value}),statChange&&jsx(StatChange,{change:statChange.change,value:statChange.value})]})};const PbDate=props=>{const{aria:aria={},alignment:alignment="left",className:className,data:data={},htmlOptions:htmlOptions={},id:id,showDayOfWeek:showDayOfWeek=false,showIcon:showIcon=false,size:size="md",unstyled:unstyled=false,value:value}=props;const weekday=DateTime$1.toWeekday(value);const month=DateTime$1.toMonth(value);const day=DateTime$1.toDay(value);const year=DateTime$1.toYear(value);const currentYear=(new Date).getFullYear();const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_date_kit",alignment),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:unstyled?jsxs(Fragment,{children:[showIcon&&jsx("div",{children:jsx(Icon,{fixedWidth:true,icon:"calendar-alt"})}),showDayOfWeek&&jsxs(Fragment,{children:[jsx("div",{children:weekday}),jsx("div",{children:"•"})]}),jsxs("span",{children:[jsxs("span",{children:[month," ",day]}),currentYear!=year&&jsx("span",{children:`, ${year}`})]})]}):size=="md"||size=="lg"?jsxs(Title,{size:4,tag:"h4",children:[showIcon&&jsx(Body$1,{className:"pb_icon_kit_container",color:"light",tag:"span",children:jsx(Icon,{fixedWidth:true,icon:"calendar-alt"})}),showDayOfWeek&&jsxs(Fragment,{children:[weekday,jsx(Body$1,{color:"light",tag:"span",text:" • "})]}),jsxs("span",{children:[month," ",day]}),currentYear!=year&&jsx("span",{children:`, ${year}`})]}):jsxs(Fragment,{children:[showIcon&&jsx(Caption,{className:"pb_icon_kit_container",tag:"span",children:jsx(Icon,{fixedWidth:true,icon:"calendar-alt",size:"sm"})}),showDayOfWeek&&jsxs(Fragment,{children:[jsx(Caption,{tag:"div",children:weekday}),jsx(Caption,{color:"light",tag:"div",text:" • "})]}),jsxs(Caption,{tag:"span",children:[month," ",day,currentYear!=year&&jsx(Fragment,{children:`, ${year}`})]})]})})};const DatePicker=props=>{if(props.plugins);const{allowInput:allowInput=false,aria:aria={},className:className,customQuickPickDates:customQuickPickDates,dark:dark=false,data:data={},defaultDate:defaultDate="",disableDate:disableDate=null,disableInput:disableInput,disableRange:disableRange=null,disableWeekdays:disableWeekdays=null,enableTime:enableTime=false,error:error,format:format="m/d/Y",hideIcon:hideIcon=false,hideLabel:hideLabel=false,htmlOptions:htmlOptions={},id:id,inLine:inLine=false,inputAria:inputAria={},inputData:inputData={},inputOnChange:inputOnChange,inputValue:inputValue,label:label="Date Picker",maxDate:maxDate,minDate:minDate,mode:mode="single",name:name,onChange:onChange=()=>{},onClose:onClose,pickerId:pickerId,placeholder:placeholder="Select Date",plugins:plugins=false,position:position,positionElement:positionElement,scrollContainer:scrollContainer,selectionType:selectionType="",showTimezone:showTimezone=false,staticPosition:staticPosition=true,thisRangesEndToday:thisRangesEndToday=false,yearRange:yearRange=[1900,2100]}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const inputAriaProps=buildAriaProps(inputAria);const inputDataProps=buildDataProps(inputData);useEffect((()=>{datePickerHelper({allowInput:allowInput,customQuickPickDates:customQuickPickDates,defaultDate:defaultDate,disableDate:disableDate,disableRange:disableRange,disableWeekdays:disableWeekdays,enableTime:enableTime,format:format,hideIcon:hideIcon,inLine:inLine,maxDate:maxDate,minDate:minDate,mode:mode,onChange:onChange,onClose:onClose,pickerId:pickerId,plugins:plugins,position:position,positionElement:positionElement,selectionType:selectionType,showTimezone:showTimezone,staticPosition:staticPosition,thisRangesEndToday:thisRangesEndToday,yearRange:yearRange,required:false},scrollContainer)}));const filteredProps={...props};if(filteredProps.marginBottom===void 0){filteredProps.marginBottom="sm"}filteredProps==null?true:delete filteredProps.position;const classes=classnames(buildCss("pb_date_picker_kit"),globalProps(filteredProps),error?"error":null,className);const iconWrapperClass=()=>{let base="cal_icon_wrapper";if(dark){base+=" dark"}if(hideLabel){base+=" no_label_shift"}if(error){base+=" error"}return base};return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs("div",{...inputAriaProps,...inputDataProps,className:"input_wrapper",children:[jsx(Caption,{className:"pb_date_picker_kit_label",text:hideLabel?null:label}),jsxs(Fragment,{children:[jsxs("div",{className:"date_picker_input_wrapper",children:[jsx("input",{autoComplete:"off",className:"date_picker_input",disabled:disableInput,id:pickerId,name:name,onChange:inputOnChange,placeholder:placeholder,value:inputValue}),error&&jsx(Body$1,{status:"negative",text:error,variant:null})]}),!hideIcon&&jsx("div",{className:iconWrapperClass(),id:`cal-icon-${pickerId}`,children:jsx(Icon,{className:"cal_icon",icon:"calendar-alt"})}),hideIcon&&inLine?jsxs("div",{children:[jsx("div",{className:iconWrapperClass(),id:`${pickerId}-icon-plus`,children:jsx(Icon,{className:"date-picker-plus-icon",icon:"plus"})}),jsx("div",{className:iconWrapperClass(),id:`${pickerId}-angle-down`,children:jsx(Icon,{className:"angle_down_icon",icon:"angle-down"})})]}):null]})]})})};const dateTimestamp$1=(dateValue,includeYear)=>{if(includeYear){return`${DateTime$1.toMonth(dateValue)} ${DateTime$1.toDay(dateValue)}, ${DateTime$1.toYear(dateValue)}`}else{return`${DateTime$1.toMonth(dateValue)} ${DateTime$1.toDay(dateValue)}`}};const dateTimeIso$1=dateValue=>DateTime$1.toIso(dateValue);const DateRangeInline=props=>{const{align:align="left",className:className,dark:dark=false,data:data={},endDate:endDate,htmlOptions:htmlOptions={},icon:icon=false,size:size="sm",startDate:startDate}=props;const dateInCurrentYear=()=>{const currentDate=new Date;return(startDate==null?void 0:startDate.getFullYear())===(endDate==null?void 0:endDate.getFullYear())&&(startDate==null?void 0:startDate.getFullYear())===currentDate.getFullYear()};const dateRangeClasses=buildCss("pb_date_range_inline_kit",align);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const renderTime=date=>jsx("time",{dateTime:dateTimeIso$1(date),children:dateInCurrentYear()?` ${dateTimestamp$1(date,false)} `:` ${dateTimestamp$1(date,true)} `});return jsx("div",{...dataProps,...htmlProps,className:classnames(dateRangeClasses,globalProps(props),className),children:jsxs("div",{className:"pb_date_range_inline_wrapper",children:[size==="xs"&&jsxs(Fragment,{children:[icon&&jsx(Caption,{dark:dark,tag:"span",children:jsx(Icon,{className:"pb_date_range_inline_icon",dark:dark,fixedWidth:true,icon:"calendar-alt",size:size,tag:"span"})}),jsx(Caption,{dark:dark,tag:"span",children:renderTime(startDate)}),jsx(Caption,{dark:dark,tag:"span",children:jsx(Icon,{className:"pb_date_range_inline_arrow",dark:dark,fixedWidth:true,icon:"long-arrow-right",tag:"span"})}),jsx(Caption,{dark:dark,tag:"span",children:renderTime(endDate)})]}),size==="sm"&&jsxs(Fragment,{children:[icon&&jsx(Body$1,{color:"light",dark:dark,tag:"span",children:jsx(Icon,{className:"pb_date_range_inline_icon",dark:dark,fixedWidth:true,icon:"calendar-alt",size:size,tag:"span"})}),jsx(Body$1,{dark:dark,tag:"span",children:renderTime(startDate)}),jsx(Body$1,{color:"light",dark:dark,tag:"span",children:jsx(Icon,{className:"pb_date_range_inline_arrow",dark:dark,fixedWidth:true,icon:"long-arrow-right",tag:"span"})}),jsx(Body$1,{dark:dark,tag:"span",children:renderTime(endDate)})]})]})})};const DateYearStacked=props=>{const{align:align="left",className:className,dark:dark=false,date:date,data:data={},htmlOptions:htmlOptions={}}=props;const css=classnames(buildCss("pb_date_year_stacked",align),globalProps(props),className);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsxs("div",{...dataProps,...htmlProps,className:css,children:[jsx(Title,{dark:dark,size:4,text:`${DateTime$1.toDay(date)} ${DateTime$1.toMonth(date).toUpperCase()}`}),jsx(Body$1,{color:"light",children:DateTime$1.toYear(date)})]})};const DateRangeStacked=props=>{const{className:className,dark:dark=false,endDate:endDate,htmlOptions:htmlOptions={},startDate:startDate,data:data={}}=props;const css=classnames(buildCss("pb_date_range_stacked"),globalProps(props),className);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsx("div",{...dataProps,...htmlProps,className:css,children:jsxs(Flex,{vertical:"center",children:[jsx(FlexItem,{children:jsx(DateYearStacked,{align:"right",dark:dark,date:startDate})}),jsx(FlexItem,{children:jsx("div",{children:jsx(Body$1,{color:"light",tag:"span",children:jsx(Icon,{className:"pb_date_range_stacked_arrow",fixedWidth:true,icon:"long-arrow-right"})})})}),jsx(FlexItem,{children:jsx(DateYearStacked,{dark:dark,date:endDate})})]})})};const sizes={sm:4,md:3};const DateStacked=props=>{const{align:align="left",bold:bold=false,reverse:reverse=false,className:className,dark:dark=false,date:date,data:data={},htmlOptions:htmlOptions={},size:size="sm"}=props;const classes=classnames(buildCss("pb_date_stacked_kit",align,size,{dark:dark,reverse:reverse}),globalProps(props),className);const currentYear=(new Date).getFullYear();const inputYear=DateTime$1.toYear(date);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsx(Fragment,{children:bold==false?jsxs("div",{...dataProps,...htmlProps,className:classes,children:[jsxs("div",{className:"pb_date_stacked_day_month",children:[jsx(Caption,{text:DateTime$1.toMonth(date).toUpperCase()}),jsx(Title,{dark:dark,size:sizes[size],text:DateTime$1.toDay(date).toString()})]}),currentYear!=inputYear&&jsx(Caption,{size:"xs",children:inputYear})]}):jsx("div",{...dataProps,...htmlProps,className:classes,children:jsxs("div",{className:"pb_date_stacked_day_month",children:[jsx(Title,{bold:true,dark:dark,size:"4",text:DateTime$1.toMonth(date)}),jsx(Title,{bold:true,dark:dark,size:"4",text:DateTime$1.toDay(date).toString()}),currentYear!=inputYear&&jsx(Title,{size:"4",children:inputYear})]})})})};const Time=props=>{const{align:align,className:className,date:date,htmlOptions:htmlOptions={},showIcon:showIcon,size:size,timeZone:timeZone,unstyled:unstyled=false,showTimezone:showTimezone=true}=props;const classes=classnames(buildCss("pb_time_kit",align,size),globalProps(props),className);const htmlProps=buildHtmlProps(htmlOptions);return jsxs("div",{...htmlProps,className:classes,children:[showIcon&&(unstyled?jsxs("span",{children:[jsx(Icon,{fixedWidth:true,icon:"clock"})," "]}):jsx(Fragment,{children:jsxs(Body$1,{color:"light",tag:"span",children:[jsx(Icon,{fixedWidth:true,icon:"clock",size:size==="md"?"":"sm"})," "]})})),jsx("time",{dateTime:date.toLocaleString(),children:jsx("span",{children:unstyled?jsxs(Fragment,{children:[jsx("span",{children:DateTime$1.toTimeWithMeridiem(date,timeZone)})," ",showTimezone&&jsx("span",{children:DateTime$1.toTimeZone(date,timeZone)})]}):size==="md"?jsxs(Fragment,{children:[jsx(Body$1,{className:"pb_time",tag:"span",text:DateTime$1.toTimeWithMeridiem(date,timeZone)})," ",showTimezone&&jsx(Body$1,{color:"light",tag:"span",text:DateTime$1.toTimeZone(date,timeZone)})]}):jsxs(Fragment,{children:[jsx(Caption,{color:"light",tag:"span",text:DateTime$1.toTimeWithMeridiem(date,timeZone)})," ",showTimezone&&jsx(Caption,{color:"light",tag:"span",text:DateTime$1.toTimeZone(date,timeZone)})]})})})]})};const DateTime=props=>{const{align:align="left",aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},showDayOfWeek:showDayOfWeek=false,datetime:datetime2,id:id,showIcon:showIcon=false,size:size="md",timeZone:timeZone="America/New_York"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_date_time",size),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs(Flex,{horizontal:align,vertical:"baseline",children:[jsx(PbDate,{showDayOfWeek:showDayOfWeek,size:size,value:datetime2}),jsx(Time,{date:datetime2,marginLeft:"sm",showIcon:showIcon,size:size,timeZone:timeZone})]})})};const TimeStackedDefault=props=>{if(props.date);const{align:align="left",className:className,dark:dark,data:data={},date:date,htmlOptions:htmlOptions={},time:time,timeZone:timeZone}=props;const classes=classnames(buildCss("pb_time_stacked_kit",align),globalProps(props),className);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsx("div",{className:classes,...dataProps,...htmlProps,children:jsx(Body$1,{className:classnames("pb_time_stacked","time-spacing"),color:"light",dark:dark,children:jsxs("time",{children:[DateTime$1.toTimeWithMeridiem(date?date:new Date(time),timeZone),jsx(Caption,{className:"pb_time_stacked",color:"light",dark:dark,tag:"span",text:DateTime$1.toTimeZone(date?date:new Date(time),timeZone)})]})})})};const DateTimeStacked=props=>{if(props.date);const{date:date,datetime:datetime2,dark:dark,htmlOptions:htmlOptions={},timeZone:timeZone="America/New_York"}=props;const classes=buildCss("pb_date_time_stacked_kit",globalProps(props));const htmlProps=buildHtmlProps(htmlOptions);return jsxs(Flex,{inline:false,vertical:"stretch",...htmlProps,...props,children:[jsx(FlexItem,{children:jsx(DateStacked,{align:"right",bold:true,dark:dark,date:date||datetime2})}),jsx(SectionSeparator,{className:"date-time-padding",orientation:"vertical"}),jsx(FlexItem,{children:jsx(TimeStackedDefault,{className:classes,dark:dark,date:date||datetime2,timeZone:timeZone})})]})};const Detail=props=>{const{aria:aria={},bold:bold=false,children:children,className:className,color:color="light",data:data={},htmlOptions:htmlOptions={},id:id="",tag:tag="div",text:text2=""}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const isBold=bold?"bold":null;const classes=classnames(buildCss("pb_detail_kit",`color`,color),isBold,globalProps(props),className);const Tag=`${tag}`;return jsx(Tag,{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:text2||children})};const DropdownContext=createContext({});const List=props=>{const{aria:aria={},borderless:borderless=false,children:children,className:className,dark:dark=false,data:data={},enableDrag:enableDrag=false,htmlOptions:htmlOptions={},id:id,layout:layout="",ordered:ordered=false,role:role,size:size="",tabIndex:tabIndex,xpadding:xpadding=false,variant:variant,text:text2}=props;const layoutClass={left:"layout_left",right:"layout_right",default:""};const childrenWithProps=React__default.Children.map(children,(child=>React__default.cloneElement(child,{text:text2,variant:variant,enableDrag:enableDrag})));const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_list_kit",layoutClass[layout],size,{dark:dark,borderless:borderless,ordered:ordered,xpadding:xpadding}),globalProps(props),className);return jsx(Fragment,{children:enableDrag?jsx(Draggable.Container,{children:jsx("div",Object.assign({className:classes},{children:ordered?jsx("ol",Object.assign({},ariaProps,dataProps,htmlProps,{className:className,id:id,role:role,tabIndex:tabIndex},{children:childrenWithProps}),void 0):jsx("ul",Object.assign({},ariaProps,dataProps,htmlProps,{className:className,id:id,role:role,tabIndex:tabIndex},{children:childrenWithProps}),void 0)}),void 0)},void 0):jsx("div",Object.assign({className:classes},{children:ordered?jsx("ol",Object.assign({},ariaProps,dataProps,htmlProps,{className:className,id:id,role:role,tabIndex:tabIndex},{children:childrenWithProps}),void 0):jsx("ul",Object.assign({},ariaProps,dataProps,htmlProps,{className:className,id:id,role:role,tabIndex:tabIndex},{children:childrenWithProps}),void 0)}),void 0)},void 0)};const ListItem=props=>{const{aria:aria={},children:children,className:className,data:data={},enableDrag:enableDrag,dragId:dragId,dragHandle:dragHandle=true,htmlOptions:htmlOptions={},id:id,tabIndex:tabIndex}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_item_kit"),globalProps(props),className);return jsx(Fragment,{children:enableDrag?jsx(Draggable.Item,Object.assign({dragId:dragId},{children:jsxs("li",Object.assign({},ariaProps,dataProps,htmlProps,{className:classes,id:id,tabIndex:tabIndex},{children:[dragHandle&&jsx("span",Object.assign({style:{verticalAlign:"middle"}},{children:jsx(Body$1,Object.assign({color:"light"},{children:jsx(Icon,{icon:"grip-dots-vertical",verticalAlign:"middle"},void 0)}),void 0)}),void 0),children]}),void 0)}),void 0):jsx("li",Object.assign({},ariaProps,dataProps,htmlProps,{className:classes,id:id,tabIndex:tabIndex},{children:children}),void 0)},void 0)};const DropdownContainer=props=>{const{aria:aria={},children:children,className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},id:id,searchbar:searchbar=false}=props;const{dropdownContainerRef:dropdownContainerRef,filteredOptions:filteredOptions,filterItem:filterItem,handleChange:handleChange,inputRef:inputRef,isDropDownClosed:isDropDownClosed,setFocusedOptionIndex:setFocusedOptionIndex,triggerRef:triggerRef}=useContext(DropdownContext);const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_dropdown_container"),`${isDropDownClosed?"close":"open"}`,globalProps(props),className);return jsxs("div",Object.assign({},ariaProps,dataProps,htmlProps,{className:classes,id:id,onMouseEnter:()=>setFocusedOptionIndex(-1),ref:dropdownContainerRef,style:triggerRef?{}:{position:"absolute"}},{children:[searchbar&&jsx(TextInput,Object.assign({dark:dark,paddingTop:"xs",paddingX:"xs"},{children:jsx("input",{onChange:handleChange,placeholder:"Select...",ref:inputRef,value:filterItem},void 0)}),void 0),jsx(List,Object.assign({dark:dark},{children:(filteredOptions===null||filteredOptions===void 0?void 0:filteredOptions.length)===0?jsx(ListItem,Object.assign({dark:dark,display:"flex",justifyContent:"center",padding:"xs"},{children:jsx(Body$1,{color:"light",dark:dark,text:"no option"},void 0)}),void 0):children}),void 0)]}),void 0)};const DropdownOption=props=>{const{aria:aria={},children:children,className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},id:id,key:key,option:option}=props;const{filteredOptions:filteredOptions,filterItem:filterItem,focusedOptionIndex:focusedOptionIndex,handleOptionClick:handleOptionClick,selected:selected}=useContext(DropdownContext);const isItemMatchingFilter=option2=>{const label=typeof option2.label==="string"?option2.label.toLowerCase():option2.label;return String(label).toLowerCase().includes(filterItem.toLowerCase())};if(!isItemMatchingFilter(option)){return null}const isFocused=focusedOptionIndex>=0&&filteredOptions[focusedOptionIndex].label===option.label;const focusedClass=isFocused&&"focused";const selectedClass=`${selected.label===option.label?"selected":"list"}`;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_dropdown_option",selectedClass,focusedClass),globalProps(props),className);return createElement("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,key:key,onClick:()=>handleOptionClick(option)},jsx(ListItem,{cursor:"pointer",dark:dark,"data-name":option.value,padding:"none",children:children?jsx("div",{className:"dropdown_option_wrapper",children:children}):jsx(Body$1,{dark:dark,text:option.label})},option.label))};const useHandleOnKeyDown=()=>{const{autocomplete:autocomplete,filteredOptions:filteredOptions,focusedOptionIndex:focusedOptionIndex,handleBackspace:handleBackspace,handleOptionClick:handleOptionClick,selected:selected,setFocusedOptionIndex:setFocusedOptionIndex,setIsDropDownClosed:setIsDropDownClosed}=useContext(DropdownContext);return e=>{if(e.key!=="Tab"&&autocomplete&&selected&&selected.label){handleBackspace()}switch(e.key){case"Backspace":case"Delete":if(autocomplete){handleBackspace()}break;case"ArrowDown":{e.preventDefault();setIsDropDownClosed(false);const nextIndex=(focusedOptionIndex+1)%filteredOptions.length;setFocusedOptionIndex(nextIndex);break}case"ArrowUp":{e.preventDefault();const nextIndexUp=(focusedOptionIndex-1+filteredOptions.length)%filteredOptions.length;setFocusedOptionIndex(nextIndexUp);break}case"Enter":if(focusedOptionIndex!==-1){e.preventDefault();handleOptionClick(filteredOptions[focusedOptionIndex]);setFocusedOptionIndex(-1)}else if(focusedOptionIndex===-1){setIsDropDownClosed(false)}break;case"Tab":setIsDropDownClosed(true);setFocusedOptionIndex(-1);break}}};const DropdownTrigger=props=>{const{aria:aria={},children:children,className:className,customDisplay:customDisplay,dark:dark=false,data:data={},htmlOptions:htmlOptions={},id:id,placeholder:placeholder}=props;const{autocomplete:autocomplete,filterItem:filterItem,handleChange:handleChange,handleWrapperClick:handleWrapperClick,inputRef:inputRef,inputWrapperRef:inputWrapperRef,isDropDownClosed:isDropDownClosed,isInputFocused:isInputFocused,selected:selected,setIsInputFocused:setIsInputFocused,toggleDropdown:toggleDropdown,triggerRef:triggerRef}=useContext(DropdownContext);const handleKeyDown=useHandleOnKeyDown();const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_dropdown_trigger"),globalProps(props),className);const triggerWrapperClasses=buildCss("dropdown_trigger_wrapper",isInputFocused&&"focus",!autocomplete&&"select_only");const customDisplayPlaceholder=selected.label?jsx("b",{children:selected.label},void 0):autocomplete?"":placeholder?placeholder:"Select...";const defaultDisplayPlaceholder=selected.label?selected.label:autocomplete?"":placeholder?placeholder:"Select...";return jsx("div",Object.assign({},ariaProps,dataProps,htmlProps,{className:classes,id:id},{children:!triggerRef&&(children?jsx("div",Object.assign({onClick:()=>toggleDropdown(),onKeyDown:handleKeyDown,ref:inputWrapperRef,style:{display:"inline-block"},tabIndex:0},{children:children}),void 0):jsx(Fragment,{children:jsxs(Flex,Object.assign({align:"center",borderRadius:"lg",className:triggerWrapperClasses,cursor:`${autocomplete?"text":"pointer"}`,htmlOptions:{onClick:()=>handleWrapperClick(),onKeyDown:handleKeyDown,tabIndex:"0",ref:inputWrapperRef},justify:"between",paddingX:"sm",paddingY:"xs"},{children:[jsx(FlexItem,{children:jsxs(Flex,Object.assign({align:"center"},{children:[customDisplay?jsxs(Flex,Object.assign({align:"center"},{children:[customDisplay,jsx(Body$1,Object.assign({dark:dark,paddingLeft:`${selected.label?"xs":"none"}`},{children:customDisplayPlaceholder}),void 0)]}),void 0):jsx(Body$1,{dark:dark,text:defaultDisplayPlaceholder},void 0),autocomplete&&jsx("input",{className:"dropdown_input",onChange:handleChange,onClick:()=>toggleDropdown(),onFocus:()=>setIsInputFocused(true),onKeyDown:handleKeyDown,placeholder:selected.label?"":placeholder?placeholder:"Select...",ref:inputRef,value:filterItem},void 0)]}),void 0)},void 0),jsx(Body$1,Object.assign({dark:dark,display:"flex",htmlOptions:{onClick:e=>{e.stopPropagation();handleWrapperClick()}}},{children:jsx(Icon,{cursor:"pointer",dark:dark,icon:`${isDropDownClosed?"chevron-down":"chevron-up"}`,size:"sm"},void 0)}),`${isDropDownClosed?"chevron-down":"chevron-up"}`)]}),void 0)},void 0))}),void 0)};const separateChildComponents=children=>{let trigger=null;let container=null;const otherChildren=[];React__default.Children.forEach(children,(child=>{if(child&&child.type===DropdownTrigger){trigger=child}else if(child&&child.type===DropdownContainer){container=child}else{otherChildren.push(child)}}));return{trigger:trigger,container:container,otherChildren:otherChildren}};const prepareSubcomponents=({children:children,hasTriggerSubcomponent:hasTriggerSubcomponent,hasContainerSubcomponent:hasContainerSubcomponent,trigger:trigger,container:container,otherChildren:otherChildren,dark:dark})=>{const componentsToRender=[];if(!hasTriggerSubcomponent&&!hasContainerSubcomponent){componentsToRender.push(jsx(DropdownTrigger,{dark:dark},void 0));componentsToRender.push(jsx(DropdownContainer,Object.assign({dark:dark},{children:children}),void 0))}else if(!hasTriggerSubcomponent&&hasContainerSubcomponent){componentsToRender.push(jsx(DropdownTrigger,{dark:dark},void 0));componentsToRender.push(children)}else if(hasTriggerSubcomponent&&!hasContainerSubcomponent){componentsToRender.push(trigger);componentsToRender.push(jsx(DropdownContainer,Object.assign({dark:dark},{children:otherChildren}),void 0))}else{componentsToRender.push(trigger);componentsToRender.push(container)}return componentsToRender};const handleClickOutside=({inputWrapperRef:inputWrapperRef,dropdownContainerRef:dropdownContainerRef,setIsDropDownClosed:setIsDropDownClosed,setFocusedOptionIndex:setFocusedOptionIndex,setIsInputFocused:setIsInputFocused})=>e=>{let targetElement=e.target;let shouldClose=true;while(targetElement&&shouldClose){if(targetElement.getAttribute("data-dropdown")==="pb-dropdown-trigger"){shouldClose=false}targetElement=targetElement.parentElement}if(inputWrapperRef.current&&!inputWrapperRef.current.contains(e.target)&&dropdownContainerRef.current&&!dropdownContainerRef.current.contains(e.target)&&shouldClose){setIsDropDownClosed(true);setFocusedOptionIndex(-1);setIsInputFocused(false)}};const Dropdown=props=>{const{aria:aria={},autocomplete:autocomplete=false,blankSelection:blankSelection="",children:children,className:className,dark:dark=false,data:data={},defaultValue:defaultValue={},error:error,htmlOptions:htmlOptions={},id:id,isClosed:isClosed=true,label:label,onSelect:onSelect,options:options,triggerRef:triggerRef}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_dropdown"),globalProps(props),className);const[isDropDownClosed,setIsDropDownClosed,toggleDropdown]=useDropdown(isClosed);const[filterItem,setFilterItem]=useState("");const[selected,setSelected]=useState(defaultValue);const[isInputFocused,setIsInputFocused]=useState(false);const[hasTriggerSubcomponent,setHasTriggerSubcomponent]=useState(true);const[hasContainerSubcomponent,setHasContainerSubcomponent]=useState(true);const[focusedOptionIndex,setFocusedOptionIndex]=useState(-1);const dropdownRef=useRef(null);const inputRef=useRef(null);const inputWrapperRef=useRef(null);const dropdownContainerRef=useRef(null);const{trigger:trigger,container:container,otherChildren:otherChildren}=separateChildComponents(children);useEffect((()=>{if(triggerRef==null?void 0:triggerRef.current){const parentElement=triggerRef.current.parentNode;if(parentElement){parentElement.style.position="relative"}}const handleClick=handleClickOutside({inputWrapperRef:inputWrapperRef,dropdownContainerRef:dropdownContainerRef,setIsDropDownClosed:setIsDropDownClosed,setFocusedOptionIndex:setFocusedOptionIndex,setIsInputFocused:setIsInputFocused});window.addEventListener("click",handleClick);return()=>{window.removeEventListener("click",handleClick)}}),[]);useEffect((()=>{setHasTriggerSubcomponent(!!trigger);setHasContainerSubcomponent(!!container)}),[]);useEffect((()=>{setIsDropDownClosed(isClosed)}),[isClosed]);const blankSelectionOption=blankSelection?[{label:blankSelection,value:""}]:[];const optionsWithBlankSelection=blankSelectionOption.concat(options);const filteredOptions=optionsWithBlankSelection==null?void 0:optionsWithBlankSelection.filter((option=>{const label2=typeof option.label==="string"?option.label.toLowerCase():option.label;return String(label2).toLowerCase().includes(filterItem.toLowerCase())}));useEffect((()=>{if(!isDropDownClosed){let newIndex=0;if(selected&&(selected==null?void 0:selected.label)){const selectedIndex=filteredOptions.findIndex((option=>option.label===selected.label));if(selectedIndex>=0){newIndex=selectedIndex}}setFocusedOptionIndex(newIndex)}}),[isDropDownClosed]);const handleChange=e=>{setFilterItem(e.target.value);setIsDropDownClosed(false)};const handleOptionClick=selectedItem=>{setSelected(selectedItem);setFilterItem("");setIsDropDownClosed(true);onSelect&&onSelect(selectedItem)};const handleWrapperClick=()=>{autocomplete&&inputRef.current.focus();toggleDropdown()};const handleBackspace=()=>{setSelected({});onSelect&&onSelect(null);setFocusedOptionIndex(-1)};const componentsToRender=prepareSubcomponents({children:children,hasTriggerSubcomponent:hasTriggerSubcomponent,hasContainerSubcomponent:hasContainerSubcomponent,trigger:trigger,container:container,otherChildren:otherChildren,dark:dark});return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,style:triggerRef?{position:"absolute"}:{position:"relative"},children:jsxs(DropdownContext.Provider,{value:{autocomplete:autocomplete,dropdownContainerRef:dropdownContainerRef,filteredOptions:filteredOptions,filterItem:filterItem,focusedOptionIndex:focusedOptionIndex,handleBackspace:handleBackspace,handleChange:handleChange,handleOptionClick:handleOptionClick,handleWrapperClick:handleWrapperClick,inputRef:inputRef,inputWrapperRef:inputWrapperRef,isDropDownClosed:isDropDownClosed,isInputFocused:isInputFocused,optionsWithBlankSelection:optionsWithBlankSelection,selected:selected,setFocusedOptionIndex:setFocusedOptionIndex,setIsDropDownClosed:setIsDropDownClosed,setIsInputFocused:setIsInputFocused,setSelected:setSelected,toggleDropdown:toggleDropdown,triggerRef:triggerRef},children:[label&&jsx(Caption,{dark:dark,marginBottom:"xs",text:label}),jsxs("div",{className:`dropdown_wrapper ${error?"error":""}`,onBlur:()=>{setTimeout((()=>{if(!dropdownRef.current.contains(document.activeElement)){setIsInputFocused(false)}}),0)},onFocus:()=>setIsInputFocused(true),ref:dropdownRef,children:[children?jsx(Fragment,{children:componentsToRender.map(((component,index)=>jsx(React__default.Fragment,{children:component},index)))}):jsxs(Fragment,{children:[jsx(DropdownTrigger,{}),jsx(DropdownContainer,{children:optionsWithBlankSelection&&(optionsWithBlankSelection==null?void 0:optionsWithBlankSelection.map((option=>jsx(Dropdown.Option,{option:option},option.id))))})]}),error&&jsx(Body$1,{status:"negative",text:error})]})]})})};Dropdown.Option=DropdownOption;Dropdown.Trigger=DropdownTrigger;Dropdown.Container=DropdownContainer;function __awaiter(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator["throw"](value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,[])).next())}))}function __generator(thisArg,body){var _={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");while(g&&(g=0,op[0]&&(_=0)),_)try{if(f=1,y&&(t=op[0]&2?y["return"]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(op[0]===6&&_.label<t[1]){_.label=t[1];t=op;break}if(t&&_.label<t[2]){_.label=t[2];_.ops.push(op);break}if(t[2])_.ops.pop();_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e];y=0}finally{f=t=0}if(op[0]&5)throw op[1];return{value:op[0]?op[1]:void 0,done:true}}}function __read(o,n){var m=typeof Symbol==="function"&&o[Symbol.iterator];if(!m)return o;var i=m.call(o),r,ar=[],e;try{while((n===void 0||n-- >0)&&!(r=i.next()).done)ar.push(r.value)}catch(error){e={error:error}}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i)}finally{if(e)throw e.error}}return ar}function __spread(){for(var ar=[],i=0;i<arguments.length;i++)ar=ar.concat(__read(arguments[i]));return ar}var COMMON_MIME_TYPES=new Map([["avi","video/avi"],["gif","image/gif"],["ico","image/x-icon"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["mkv","video/x-matroska"],["mov","video/quicktime"],["mp4","video/mp4"],["pdf","application/pdf"],["png","image/png"],["zip","application/zip"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]]);function toFileWithPath(file,path){var f=withMimeType(file);if(typeof f.path!=="string"){var webkitRelativePath=file.webkitRelativePath;Object.defineProperty(f,"path",{value:typeof path==="string"?path:typeof webkitRelativePath==="string"&&webkitRelativePath.length>0?webkitRelativePath:file.name,writable:false,configurable:false,enumerable:true})}return f}function withMimeType(file){var name=file.name;var hasExtension=name&&name.lastIndexOf(".")!==-1;if(hasExtension&&!file.type){var ext=name.split(".").pop().toLowerCase();var type=COMMON_MIME_TYPES.get(ext);if(type){Object.defineProperty(file,"type",{value:type,writable:false,configurable:false,enumerable:true})}}return file}var FILES_TO_IGNORE=[".DS_Store","Thumbs.db"];function fromEvent(evt){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(_a){return[2,isDragEvt(evt)&&evt.dataTransfer?getDataTransferFiles(evt.dataTransfer,evt.type):getInputFiles(evt)]}))}))}function isDragEvt(value){return!!value.dataTransfer}function getInputFiles(evt){var files=isInput(evt.target)?evt.target.files?fromList(evt.target.files):[]:[];return files.map((function(file){return toFileWithPath(file)}))}function isInput(value){return value!==null}function getDataTransferFiles(dt,type){return __awaiter(this,void 0,void 0,(function(){var items,files;return __generator(this,(function(_a){switch(_a.label){case 0:if(!dt.items)return[3,2];items=fromList(dt.items).filter((function(item){return item.kind==="file"}));if(type!=="drop"){return[2,items]}return[4,Promise.all(items.map(toFilePromises))];case 1:files=_a.sent();return[2,noIgnoredFiles(flatten(files))];case 2:return[2,noIgnoredFiles(fromList(dt.files).map((function(file){return toFileWithPath(file)})))]}}))}))}function noIgnoredFiles(files){return files.filter((function(file){return FILES_TO_IGNORE.indexOf(file.name)===-1}))}function fromList(items){var files=[];for(var i=0;i<items.length;i++){var file=items[i];files.push(file)}return files}function toFilePromises(item){if(typeof item.webkitGetAsEntry!=="function"){return fromDataTransferItem(item)}var entry=item.webkitGetAsEntry();if(entry&&entry.isDirectory){return fromDirEntry(entry)}return fromDataTransferItem(item)}function flatten(items){return items.reduce((function(acc,files){return __spread(acc,Array.isArray(files)?flatten(files):[files])}),[])}function fromDataTransferItem(item){var file=item.getAsFile();if(!file){return Promise.reject(item+" is not a File")}var fwp=toFileWithPath(file);return Promise.resolve(fwp)}function fromEntry(entry){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(_a){return[2,entry.isDirectory?fromDirEntry(entry):fromFileEntry(entry)]}))}))}function fromDirEntry(entry){var reader=entry.createReader();return new Promise((function(resolve,reject){var entries=[];function readEntries(){var _this=this;reader.readEntries((function(batch){return __awaiter(_this,void 0,void 0,(function(){var files,err_1,items;return __generator(this,(function(_a){switch(_a.label){case 0:if(!!batch.length)return[3,5];_a.label=1;case 1:_a.trys.push([1,3,,4]);return[4,Promise.all(entries)];case 2:files=_a.sent();resolve(files);return[3,4];case 3:err_1=_a.sent();reject(err_1);return[3,4];case 4:return[3,6];case 5:items=Promise.all(batch.map(fromEntry));entries.push(items);readEntries();_a.label=6;case 6:return[2]}}))}))}),(function(err){reject(err)}))}readEntries()}))}function fromFileEntry(entry){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(_a){return[2,new Promise((function(resolve,reject){entry.file((function(file){var fwp=toFileWithPath(file,entry.fullPath);resolve(fwp)}),(function(err){reject(err)}))}))]}))}))}var _default$1=function(file,acceptedFiles){if(file&&acceptedFiles){var acceptedFilesArray=Array.isArray(acceptedFiles)?acceptedFiles:acceptedFiles.split(",");var fileName=file.name||"";var mimeType=(file.type||"").toLowerCase();var baseMimeType=mimeType.replace(/\/.*$/,"");return acceptedFilesArray.some((function(type){var validType=type.trim().toLowerCase();if(validType.charAt(0)==="."){return fileName.toLowerCase().endsWith(validType)}else if(validType.endsWith("/*")){return baseMimeType===validType.replace(/\/.*$/,"")}return mimeType===validType}))}return true};function fileAccepted(file,accept){return file.type==="application/x-moz-file"||_default$1(file,accept)}function fileMatchSize(file,minSize,maxSize){if(isDefined(file.size)){if(isDefined(minSize)&&isDefined(maxSize))return file.size>=minSize&&file.size<=maxSize;else if(isDefined(minSize))return file.size>=minSize;else if(isDefined(maxSize))return file.size<=maxSize}return true}function isDefined(value){return value!==void 0&&value!==null}function allFilesAccepted(_ref){var files=_ref.files,accept=_ref.accept,minSize=_ref.minSize,maxSize=_ref.maxSize,multiple=_ref.multiple;if(!multiple&&files.length>1){return false}return files.every((function(file){return fileAccepted(file,accept)&&fileMatchSize(file,minSize,maxSize)}))}function isPropagationStopped(event){if(typeof event.isPropagationStopped==="function"){return event.isPropagationStopped()}else if(typeof event.cancelBubble!=="undefined"){return event.cancelBubble}return false}function isEvtWithFiles(event){if(!event.dataTransfer){return!!event.target&&!!event.target.files}return Array.prototype.some.call(event.dataTransfer.types,(function(type){return type==="Files"||type==="application/x-moz-file"}))}function onDocumentDragOver(event){event.preventDefault()}function isIe(userAgent){return userAgent.indexOf("MSIE")!==-1||userAgent.indexOf("Trident/")!==-1}function isEdge(userAgent){return userAgent.indexOf("Edge/")!==-1}function isIeOrEdge(){var userAgent=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return isIe(userAgent)||isEdge(userAgent)}function composeEventHandlers(){for(var _len=arguments.length,fns=new Array(_len),_key=0;_key<_len;_key++){fns[_key]=arguments[_key]}return function(event){for(var _len2=arguments.length,args=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){args[_key2-1]=arguments[_key2]}return fns.some((function(fn){if(!isPropagationStopped(event)&&fn){fn.apply(void 0,[event].concat(args))}return isPropagationStopped(event)}))}}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||Object.prototype.toString.call(iter)==="[object Arguments]")return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i<arr.length;i++){arr2[i]=arr[i]}return arr2}}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function _iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||Object.prototype.toString.call(arr)==="[object Arguments]")){return}var _arr=[];var _n=true;var _d=false;var _e=void 0;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function ownKeys$2(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}));keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys$2(source,true).forEach((function(key){_defineProperty$2(target,key,source[key])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys$2(source).forEach((function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}))}}return target}function _defineProperty$2(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _objectWithoutProperties$2(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose$2(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose$2(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key]}return target}var Dropzone=forwardRef((function(_ref,ref){var children=_ref.children,params=_objectWithoutProperties$2(_ref,["children"]);var _useDropzone=useDropzone(params),open=_useDropzone.open,props=_objectWithoutProperties$2(_useDropzone,["open"]);useImperativeHandle(ref,(function(){return{open:open}}),[open]);return React__default.createElement(Fragment$1,null,children(_objectSpread({},props,{open:open})))}));Dropzone.displayName="Dropzone";Dropzone.propTypes={children:PropTypes.func,accept:PropTypes.oneOfType([PropTypes.string,PropTypes.arrayOf(PropTypes.string)]),multiple:PropTypes.bool,preventDropOnDocument:PropTypes.bool,noClick:PropTypes.bool,noKeyboard:PropTypes.bool,noDrag:PropTypes.bool,noDragEventsBubbling:PropTypes.bool,minSize:PropTypes.number,maxSize:PropTypes.number,disabled:PropTypes.bool,getFilesFromEvent:PropTypes.func,onFileDialogCancel:PropTypes.func,onDragEnter:PropTypes.func,onDragLeave:PropTypes.func,onDragOver:PropTypes.func,onDrop:PropTypes.func,onDropAccepted:PropTypes.func,onDropRejected:PropTypes.func};var initialState$1={isFocused:false,isFileDialogActive:false,isDragActive:false,isDragAccept:false,isDragReject:false,draggedFiles:[],acceptedFiles:[],rejectedFiles:[]};function useDropzone(){var _ref2=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},accept=_ref2.accept,_ref2$disabled=_ref2.disabled,disabled=_ref2$disabled===void 0?false:_ref2$disabled,_ref2$getFilesFromEve=_ref2.getFilesFromEvent,getFilesFromEvent=_ref2$getFilesFromEve===void 0?fromEvent:_ref2$getFilesFromEve,_ref2$maxSize=_ref2.maxSize,maxSize=_ref2$maxSize===void 0?Infinity:_ref2$maxSize,_ref2$minSize=_ref2.minSize,minSize=_ref2$minSize===void 0?0:_ref2$minSize,_ref2$multiple=_ref2.multiple,multiple=_ref2$multiple===void 0?true:_ref2$multiple,onDragEnter=_ref2.onDragEnter,onDragLeave=_ref2.onDragLeave,onDragOver=_ref2.onDragOver,onDrop=_ref2.onDrop,onDropAccepted=_ref2.onDropAccepted,onDropRejected=_ref2.onDropRejected,onFileDialogCancel=_ref2.onFileDialogCancel,_ref2$preventDropOnDo=_ref2.preventDropOnDocument,preventDropOnDocument=_ref2$preventDropOnDo===void 0?true:_ref2$preventDropOnDo,_ref2$noClick=_ref2.noClick,noClick=_ref2$noClick===void 0?false:_ref2$noClick,_ref2$noKeyboard=_ref2.noKeyboard,noKeyboard=_ref2$noKeyboard===void 0?false:_ref2$noKeyboard,_ref2$noDrag=_ref2.noDrag,noDrag=_ref2$noDrag===void 0?false:_ref2$noDrag,_ref2$noDragEventsBub=_ref2.noDragEventsBubbling,noDragEventsBubbling=_ref2$noDragEventsBub===void 0?false:_ref2$noDragEventsBub;var rootRef=useRef(null);var inputRef=useRef(null);var _useReducer=useReducer(reducer,initialState$1),_useReducer2=_slicedToArray(_useReducer,2),state=_useReducer2[0],dispatch=_useReducer2[1];var isFocused=state.isFocused,isFileDialogActive=state.isFileDialogActive,draggedFiles=state.draggedFiles;var openFileDialog=useCallback((function(){if(inputRef.current){dispatch({type:"openDialog"});inputRef.current.value=null;inputRef.current.click()}}),[dispatch]);var onWindowFocus=function onWindowFocus2(){if(isFileDialogActive){setTimeout((function(){if(inputRef.current){var files=inputRef.current.files;if(!files.length){dispatch({type:"closeDialog"});if(typeof onFileDialogCancel==="function"){onFileDialogCancel()}}}}),300)}};useEffect((function(){window.addEventListener("focus",onWindowFocus,false);return function(){window.removeEventListener("focus",onWindowFocus,false)}}),[inputRef,isFileDialogActive,onFileDialogCancel]);var onKeyDownCb=useCallback((function(event){if(!rootRef.current||!rootRef.current.isEqualNode(event.target)){return}if(event.keyCode===32||event.keyCode===13){event.preventDefault();openFileDialog()}}),[rootRef,inputRef]);var onFocusCb=useCallback((function(){dispatch({type:"focus"})}),[]);var onBlurCb=useCallback((function(){dispatch({type:"blur"})}),[]);var onClickCb=useCallback((function(){if(noClick){return}if(isIeOrEdge()){setTimeout(openFileDialog,0)}else{openFileDialog()}}),[inputRef,noClick]);var dragTargetsRef=useRef([]);var onDocumentDrop=function onDocumentDrop2(event){if(rootRef.current&&rootRef.current.contains(event.target)){return}event.preventDefault();dragTargetsRef.current=[]};useEffect((function(){if(preventDropOnDocument){document.addEventListener("dragover",onDocumentDragOver,false);document.addEventListener("drop",onDocumentDrop,false)}return function(){if(preventDropOnDocument){document.removeEventListener("dragover",onDocumentDragOver);document.removeEventListener("drop",onDocumentDrop)}}}),[rootRef,preventDropOnDocument]);var onDragEnterCb=useCallback((function(event){event.preventDefault();event.persist();stopPropagation(event);if(dragTargetsRef.current.indexOf(event.target)===-1){dragTargetsRef.current=[].concat(_toConsumableArray(dragTargetsRef.current),[event.target])}if(isEvtWithFiles(event)){Promise.resolve(getFilesFromEvent(event)).then((function(draggedFiles2){if(isPropagationStopped(event)&&!noDragEventsBubbling){return}dispatch({draggedFiles:draggedFiles2,isDragActive:true,type:"setDraggedFiles"});if(onDragEnter){onDragEnter(event)}}))}}),[getFilesFromEvent,onDragEnter,noDragEventsBubbling]);var onDragOverCb=useCallback((function(event){event.preventDefault();event.persist();stopPropagation(event);if(event.dataTransfer){try{event.dataTransfer.dropEffect="copy"}catch(_unused){}}if(isEvtWithFiles(event)&&onDragOver){onDragOver(event)}return false}),[onDragOver,noDragEventsBubbling]);var onDragLeaveCb=useCallback((function(event){event.preventDefault();event.persist();stopPropagation(event);var targets=dragTargetsRef.current.filter((function(target){return target!==event.target&&rootRef.current&&rootRef.current.contains(target)}));dragTargetsRef.current=targets;if(targets.length>0){return}dispatch({isDragActive:false,type:"setDraggedFiles",draggedFiles:[]});if(isEvtWithFiles(event)&&onDragLeave){onDragLeave(event)}}),[rootRef,onDragLeave,noDragEventsBubbling]);var onDropCb=useCallback((function(event){event.preventDefault();event.persist();stopPropagation(event);dragTargetsRef.current=[];if(isEvtWithFiles(event)){Promise.resolve(getFilesFromEvent(event)).then((function(files){if(isPropagationStopped(event)&&!noDragEventsBubbling){return}var acceptedFiles=[];var rejectedFiles=[];files.forEach((function(file){if(fileAccepted(file,accept)&&fileMatchSize(file,minSize,maxSize)){acceptedFiles.push(file)}else{rejectedFiles.push(file)}}));if(!multiple&&acceptedFiles.length>1){rejectedFiles.push.apply(rejectedFiles,_toConsumableArray(acceptedFiles.splice(0)))}dispatch({acceptedFiles:acceptedFiles,rejectedFiles:rejectedFiles,type:"setFiles"});if(onDrop){onDrop(acceptedFiles,rejectedFiles,event)}if(rejectedFiles.length>0&&onDropRejected){onDropRejected(rejectedFiles,event)}if(acceptedFiles.length>0&&onDropAccepted){onDropAccepted(acceptedFiles,event)}}))}dispatch({type:"reset"})}),[multiple,accept,minSize,maxSize,getFilesFromEvent,onDrop,onDropAccepted,onDropRejected,noDragEventsBubbling]);var composeHandler=function composeHandler2(fn){return disabled?null:fn};var composeKeyboardHandler=function composeKeyboardHandler2(fn){return noKeyboard?null:composeHandler(fn)};var composeDragHandler=function composeDragHandler2(fn){return noDrag?null:composeHandler(fn)};var stopPropagation=function stopPropagation2(event){if(noDragEventsBubbling){event.stopPropagation()}};var getRootProps=useMemo((function(){return function(){var _ref3=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},_ref3$refKey=_ref3.refKey,refKey=_ref3$refKey===void 0?"ref":_ref3$refKey,onKeyDown=_ref3.onKeyDown,onFocus=_ref3.onFocus,onBlur=_ref3.onBlur,onClick=_ref3.onClick,onDragEnter2=_ref3.onDragEnter,onDragOver2=_ref3.onDragOver,onDragLeave2=_ref3.onDragLeave,onDrop2=_ref3.onDrop,rest=_objectWithoutProperties$2(_ref3,["refKey","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return _objectSpread(_defineProperty$2({onKeyDown:composeKeyboardHandler(composeEventHandlers(onKeyDown,onKeyDownCb)),onFocus:composeKeyboardHandler(composeEventHandlers(onFocus,onFocusCb)),onBlur:composeKeyboardHandler(composeEventHandlers(onBlur,onBlurCb)),onClick:composeHandler(composeEventHandlers(onClick,onClickCb)),onDragEnter:composeDragHandler(composeEventHandlers(onDragEnter2,onDragEnterCb)),onDragOver:composeDragHandler(composeEventHandlers(onDragOver2,onDragOverCb)),onDragLeave:composeDragHandler(composeEventHandlers(onDragLeave2,onDragLeaveCb)),onDrop:composeDragHandler(composeEventHandlers(onDrop2,onDropCb))},refKey,rootRef),!disabled&&!noKeyboard?{tabIndex:0}:{},{},rest)}}),[rootRef,onKeyDownCb,onFocusCb,onBlurCb,onClickCb,onDragEnterCb,onDragOverCb,onDragLeaveCb,onDropCb,noKeyboard,noDrag,disabled]);var onInputElementClick=useCallback((function(event){event.stopPropagation()}),[]);var getInputProps=useMemo((function(){return function(){var _ref4=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},_ref4$refKey=_ref4.refKey,refKey=_ref4$refKey===void 0?"ref":_ref4$refKey,onChange=_ref4.onChange,onClick=_ref4.onClick,rest=_objectWithoutProperties$2(_ref4,["refKey","onChange","onClick"]);var inputProps=_defineProperty$2({accept:accept,multiple:multiple,type:"file",style:{display:"none"},onChange:composeHandler(composeEventHandlers(onChange,onDropCb)),onClick:composeHandler(composeEventHandlers(onClick,onInputElementClick)),autoComplete:"off",tabIndex:-1},refKey,inputRef);return _objectSpread({},inputProps,{},rest)}}),[inputRef,accept,multiple,onDropCb,disabled]);var fileCount=draggedFiles.length;var isDragAccept=fileCount>0&&allFilesAccepted({files:draggedFiles,accept:accept,minSize:minSize,maxSize:maxSize,multiple:multiple});var isDragReject=fileCount>0&&!isDragAccept;return _objectSpread({},state,{isDragAccept:isDragAccept,isDragReject:isDragReject,isFocused:isFocused&&!disabled,getRootProps:getRootProps,getInputProps:getInputProps,rootRef:rootRef,inputRef:inputRef,open:composeHandler(openFileDialog)})}function reducer(state,action){switch(action.type){case"focus":return _objectSpread({},state,{isFocused:true});case"blur":return _objectSpread({},state,{isFocused:false});case"openDialog":return _objectSpread({},state,{isFileDialogActive:true});case"closeDialog":return _objectSpread({},state,{isFileDialogActive:false});case"setDraggedFiles":var isDragActive=action.isDragActive,draggedFiles=action.draggedFiles;return _objectSpread({},state,{draggedFiles:draggedFiles,isDragActive:isDragActive});case"setFiles":return _objectSpread({},state,{acceptedFiles:action.acceptedFiles,rejectedFiles:action.rejectedFiles});case"reset":return _objectSpread({},state,{isFileDialogActive:false,isDragActive:false,draggedFiles:[],acceptedFiles:[],rejectedFiles:[]});default:return state}}const getFormattedFileSize=fileSize=>`${fileSize/1e6} MB`;const FileUpload=props=>{const{accept:accept=null,acceptedFilesDescription:acceptedFilesDescription="",className:className,customMessage:customMessage,data:data={},htmlOptions:htmlOptions={},maxSize:maxSize,onFilesAccepted:onFilesAccepted=noop$2,onFilesRejected:onFilesRejected=noop$2}=props;const onDrop=useCallback((files=>{onFilesAccepted(files)}),[onFilesAccepted]);const{getRootProps:getRootProps,getInputProps:getInputProps,isDragActive:isDragActive,rejectedFiles:rejectedFiles}=useDropzone({accept:accept,maxSize:maxSize,onDrop:onDrop});const prevRejected=useRef(null);const maxFileSizeText=`Max file size is ${getFormattedFileSize(maxSize)}.`;useEffect((()=>{if(rejectedFiles===prevRejected.current)return;const isFileTooLarge=maxSize&&rejectedFiles.length>0&&rejectedFiles[0].size>maxSize;if(isFileTooLarge){onFilesRejected(`File size is too large! ${maxFileSizeText}`,rejectedFiles)}prevRejected.current=rejectedFiles}),[maxFileSizeText,maxSize,onFilesRejected,rejectedFiles]);const acceptedFileTypes=()=>accept.map((fileType=>{if(fileType.startsWith("image/")){return fileType.replace("image/"," ")}else{return fileType}}));const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const getDescription=()=>customMessage?customMessage:`Choose a file or drag it here.${accept===null?"":` The accepted file types are: ${acceptedFilesDescription||acceptedFileTypes()}.`}${maxSize?` ${maxFileSizeText}`:""}`;return jsx("div",{className:classnames(buildCss("pb_file_upload_kit"),globalProps(props),className),...dataProps,...htmlProps,...getRootProps(),children:jsxs(Card,{children:[jsx("input",{...getInputProps()}),jsx(Body$1,{color:"light",children:isDragActive?jsx("p",{children:"Drop the files here ..."}):jsx("p",{children:getDescription()})})]})})};const hiddenFilters=value=>isEmpty(value)&&value!==true;const CurrentFilters=({dark:dark,filters:filters})=>{const displayableFilters=omitBy(filters,hiddenFilters);return jsxs("div",{className:"maskContainer",children:[isEmpty(filters)&&jsx("div",{className:"filters",children:jsx(Body$1,{color:"light",paddingLeft:"xs",size:4,tag:"span",text:"No Filter Selected"})}),!isEmpty(filters)&&jsxs("div",{className:"filters",children:[jsx("div",{className:"left_gradient"}),map(displayableFilters,((value,name)=>jsx("div",{className:"filter",children:value===true?jsx(Title,{dark:dark,size:4,tag:"h4",text:name}):jsxs("div",{children:[jsx(Caption,{dark:dark,text:name}),jsx(Title,{dark:dark,size:4,tag:"h4",text:value})]})},`filter-${name}`))),jsx("div",{className:"right_gradient"})]})]})};const FilterBackground=props=>{const{background:background=true,className:className,children:children,dark:dark}=props;return jsx("div",{className:classnames(`pb_filter_kit ${className}`,globalProps(props)),children:background?jsx(Card,{dark:dark,padding:"none",children:children}):jsx(Fragment,{children:children})})};const FiltersPopover=({children:children,dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement="bottom-start"})=>{const[hide2,updateHide]=useState(true);const toggle=()=>updateHide(!hide2);const filterButton=jsx(CircleIconButton,{dark:dark,icon:"filter",id:"filter",onClick:toggle,variant:"secondary"});return jsx(PbReactPopover,{closeOnClick:"outside",maxHeight:maxHeight,minWidth:minWidth,placement:placement,reference:filterButton,shouldClosePopover:updateHide,show:!hide2,children:jsx("div",{className:"pb-form",children:typeof children==="function"?children({closePopover:()=>updateHide(true)}):children})})};const TitleCount=props=>{const{align:align="left",aria:aria={},className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},count:count2,id:id,title:title,size:size="sm"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const css=classnames(buildCss("pb_title_count_kit",align,size),globalProps(props),className);const formatCount=count2.toLocaleString();return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:css,id:id,children:[jsx(Title,{className:title!==void 0?"pb_title_count_text":"",dark:dark,size:size==="lg"?3:4,text:title}),jsx(Body$1,{color:"light",dark:dark,children:count2&&formatCount})]})};const resultsText=results=>results==1?"Result":"Results";const ResultsCount=({dark:dark,results:results,title:title})=>{const resultTitle=()=>jsx(TitleCount,{align:"center",count:results,dark:dark,title:`${resultsText(results)}:`});const justResults=()=>jsx(Caption,{className:"filter-results",dark:dark,size:"xs",text:`${results} ${resultsText(results)}`});const displayResultsCount=()=>{if(results&&title){return jsx(Fragment,{children:resultTitle()})}else if(results){return jsx(Fragment,{children:justResults()})}else{return jsx("div",{})}};return jsx(Fragment,{children:displayResultsCount()})};const nextValue=(value,name)=>{const current=find$1(value,{name:name});return{name:name,dir:current&¤t.dir=="asc"?"desc":"asc"}};const directionIcon=dir=>dir=="asc"?"sort-amount-up":"sort-amount-down";const renderOptions=(options,value,handleChange)=>map(options,((label,name)=>{const next=nextValue(value,name);return jsx(ListItem,{children:jsx(Button,{htmlType:void 0,onClick:partial(handleChange,next),text:` ${label}`,variant:"link"})},`option-${next.name}-${next.dir}`)}));const SortMenu=({dark:dark,options:options,value:value,onChange:onChange})=>{const[hide2,updateHide]=useState(true);const toggle=()=>updateHide(!hide2);const handleChange=value2=>{updateHide(true);onChange([value2])};const sortButton=jsx(Button,{dark:dark,htmlType:void 0,id:"sort-button",onClick:toggle,paddingRight:"none",variant:"link",children:map(value,(({dir:dir,name:name})=>jsxs("span",{children:[` ${options[name]}`,jsx(Icon,{dark:dark,icon:directionIcon(dir)})]},`current-sort-${name}-${dir}`)))});return jsx(PbReactPopover,{className:"pb_filter_sort_menu",closeOnClick:"outside",padding:"none",placement:"bottom",reference:sortButton,shouldClosePopover:updateHide,show:!hide2,children:jsx(List,{children:renderOptions(options,value,handleChange)})})};const FilterSingle=({onSortChange:onSortChange,sortOptions:sortOptions,sortValue:sortValue,filters:filters,results:results,children:children,dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement,...bgProps})=>jsx(FilterBackground,{dark:dark,...bgProps,children:jsxs(Flex,{orientation:"row",paddingRight:"lg",vertical:"center",children:[children&&jsxs(Fragment,{children:[jsx(FiltersPopover,{dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement,children:children}),jsx(CurrentFilters,{dark:dark,filters:filters})]}),jsx(ResultsCount,{dark:dark,results:results}),!isEmpty(sortOptions)&&jsx(SortMenu,{dark:dark,onChange:onSortChange,options:sortOptions,value:sortValue})]})});const FilterDouble=({onSortChange:onSortChange,sortOptions:sortOptions,sortValue:sortValue,filters:filters,results:results,children:children,dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement,...bgProps})=>jsxs(FilterBackground,{dark:dark,...bgProps,children:[jsxs(Flex,{orientation:"row",vertical:"center",children:[jsx(FiltersPopover,{dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement,children:children}),jsx(CurrentFilters,{dark:dark,filters:filters})]}),jsx(SectionSeparator,{dark:dark}),jsxs(Flex,{className:"filter-bottom",orientation:"row",spacing:"between",vertical:"center",children:[jsx(ResultsCount,{dark:dark,results:results,title:true}),jsxs(Flex,{orientation:"row",vertical:"center",children:[jsx(Caption,{dark:dark,text:"sort by:"}),jsx(SortMenu,{dark:dark,onChange:onSortChange,options:sortOptions,value:sortValue})]})]})]});const Filter=({double:double=false,...templateProps})=>{const displayFilter=()=>{if(double===true){return jsx(FilterDouble,{...templateProps})}else{return jsx(FilterSingle,{...templateProps})}};return jsx(Fragment,{children:displayFilter()})};const iconMap={success:"check",error:"exclamation-triangle",neutral:"info-circle",tip:"info-circle"};const FixedConfirmationToast=props=>{const[showToast,toggleToast]=useState(true);const{autoClose:autoClose=0,children:children,className:className,closeable:closeable=false,horizontal:horizontal,htmlOptions:htmlOptions={},icon:icon,multiLine:multiLine=false,onClose:onClose=()=>void 0,open:open=true,status:status="neutral",text:text2,vertical:vertical}=props;const returnedIcon=icon||iconMap[status];const iconClass=icon?"custom_icon":"";const css=classnames(`pb_fixed_confirmation_toast_kit_${status}`,{_multi_line:multiLine},{[`positioned_toast ${vertical} ${horizontal}`]:vertical&&horizontal},`${iconClass}`,globalProps(props),className);const htmlProps=buildHtmlProps(htmlOptions);const autoCloseToast=()=>{if(autoClose&&open){setTimeout((()=>{toggleToast(false);onClose()}),autoClose)}};useEffect((()=>{toggleToast(open);autoCloseToast()}),[open]);const handleClick=()=>{toggleToast(!closeable);onClose()};return jsx(Fragment,{children:showToast&&jsxs("div",{className:css,onClick:handleClick,...htmlProps,children:[returnedIcon&&jsx(Icon,{className:"pb_icon",fixedWidth:true,icon:returnedIcon}),children&&children||text2&&jsx(Title,{className:"pb_fixed_confirmation_toast_text",flex:"1",size:4,text:text2}),closeable&&jsx(Icon,{className:"pb_icon",cursor:"pointer",fixedWidth:false,icon:"times"})]})})};const FormGroup=props=>{const{aria:aria={},className:className,data:data={},fullWidth:fullWidth=false,htmlOptions:htmlOptions={},id:id,children:children}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_form_group_kit",{full:fullWidth}),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children})};const typeMap={home:"H#",project:"P#",appointment:"A#",default:"#"};const Hashtag=props=>{const{aria:aria={},className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},id:id,newWindow:newWindow,rel:rel,text:text2,type:type="default",url:url}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_hashtag_kit"),globalProps(props),className);return jsx("span",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsx("a",{href:url,rel:newWindow?"noreferrer":rel,target:newWindow?"_blank":"_self",children:jsx(Badge,{dark:dark,text:typeMap[type]+text2,variant:"primary"})})})};const HomeAddressStreet=props=>{const{address:address,addressCont:addressCont,aria:aria={},city:city,className:className,data:data={},dark:dark=false,emphasis:emphasis="street",htmlOptions:htmlOptions={},homeId:homeId,homeUrl:homeUrl,newWindow:newWindow,houseStyle:houseStyle,state:state,zipcode:zipcode,territory:territory}=props;const classes=(className2,dark2)=>classnames({pb_home_address_street:!dark2,pb_home_address_street_dark:dark2},globalProps(props),className2);const dataProps=buildDataProps(data);const ariaProps=buildAriaProps(aria);const htmlProps=buildHtmlProps(htmlOptions);return jsxs("div",{className:classes(className,dark),...ariaProps,...dataProps,...htmlProps,children:[emphasis=="street"&&jsxs("div",{children:[jsx(Title,{className:"pb_home_address_street_address",dark:dark,size:4,children:joinPresent([titleize(address),houseStyle]," · ")}),jsx(Title,{className:"pb_home_address_street_address",dark:dark,size:4,children:titleize(addressCont)}),jsx(Body$1,{color:"light",children:`${titleize(city)}, ${state} ${zipcode}`})]}),emphasis=="city"&&jsxs("div",{children:[jsx(Body$1,{color:"light",children:joinPresent([titleize(address),houseStyle]," · ")}),jsx(Body$1,{color:"light",children:titleize(addressCont)}),jsxs("div",{children:[jsx(Title,{className:"pb_home_address_street_address",dark:dark,size:4,tag:"span",children:`${titleize(city)}, ${state}`}),jsx(Body$1,{color:"light",tag:"span",children:` ${zipcode}`})]})]}),homeId&&jsx(Hashtag,{classname:"home-hashtag",dark:dark,marginRight:"xxs",newWindow:newWindow,text:homeId,type:"home",url:homeUrl||"#"}),jsx(Body$1,{color:"light",tag:"span",children:jsx("small",{children:territory})})]})};const IconStatValue=props=>{const{aria:aria={},className:className,data:data={},dark:dark=false,htmlOptions:htmlOptions={},icon:icon,id:id,orientation:orientation="horizontal",size:size="sm",text:text2="",unit:unit="",value:value=0,variant:variant="default"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_icon_stat_value_kit",orientation,size,variant),globalProps(props),className);const titleSize=function(size2){if(size2=="lg"){return jsx(Title,{dark:dark,size:1,tag:"span",text:`${value}`})}else if(size2=="md"){return jsx(Title,{dark:dark,size:2,tag:"span",text:`${value}`})}else{return jsx(Title,{dark:dark,size:3,tag:"span",text:`${value}`})}};return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[jsx(IconCircle,{dark:dark,icon:icon,size:size,variant:variant}),jsxs("div",{children:[jsxs(Flex,{align:"baseline",children:[titleSize(size)," ",jsx(Body$1,{dark:dark,text:unit})]}),jsx(Caption,{dark:dark,text:text2})]})]})};const IconValue=props=>{const{align:align="left",aria:aria={},className:className,dark:dark,data:data={},htmlOptions:htmlOptions={},icon:icon,id:id,text:text2}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_icon_value_kit",align),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs(Body$1,{color:"light",dark:dark,children:[jsx(Icon,{dark:dark,fixedWidth:true,icon:icon}),text2]})})};const Pill=props=>{const{aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,text:text2,variant:variant="neutral",textTransform:textTransform="lowercase"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_pill_kit",variant,textTransform),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsx(Title,{className:"pb_pill_text",size:4,tag:"div",text:text2})})};const LabelPill=props=>{const{aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,label:label,pillValue:pillValue,variant:variant="neutral"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const css=classnames("pb_label_pill_kit",globalProps(props),className);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:css,id:id,children:[jsx(Caption,{className:"pb_label_pill_label",text:label}),jsx(Pill,{className:"pb_label_pill_pill",text:pillValue,variant:variant})]})};const dateString=value=>{const month=DateTime$1.toMonthNum(value);const day=DateTime$1.toDay(value);return` · ${month}/${day}`};const LabelValue=props=>{const{active:active=false,aria:aria={},className:className,dark:dark=false,data:data={},date:date,description:description,htmlOptions:htmlOptions={},icon:icon,id:id,label:label,title:title,value:value,variant:variant="default"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const variantClass=variant==="details"?"details":"";const classes=classnames(buildCss("pb_label_value_kit",variantClass),globalProps(props),className);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,title:title,children:[jsx(Caption,{dark:dark,text:label}),variant==="details"?jsxs(Flex,{inline:true,vertical:"center",children:[icon&&jsx(Body$1,{color:"light",dark:dark,marginRight:"xs",children:jsx(Icon,{dark:dark,fixedWidth:true,icon:icon})}),description&&jsx(Body$1,{color:"light",dark:dark,marginRight:"xs",text:description}),active===true?jsxs(Flex,{inline:true,vertical:"center",children:[title&&jsx(Title,{dark:dark,size:4,text:title,variant:"link"}),date&&jsx(Title,{dark:dark,marginLeft:"xs",size:4,text:" "+dateString(date),variant:"link"})]}):jsxs(Fragment,{children:[title&&jsx(Title,{dark:dark,size:4,text:title}),date&&jsx(Title,{dark:dark,marginLeft:"xs",size:4,text:" "+dateString(date)})]})]}):jsx(Body$1,{dark:dark,text:value})]})};const Side=props=>{const{children:children,className:className}=props;return jsx("div",{className:classnames("layout_sidebar",globalProps(props),className),children:children})};const Body=props=>{const{children:children,className:className}=props;return jsx("div",{className:classnames("layout_body",globalProps(props),className),children:children})};const Item=props=>{const{children:children,className:className,size:size="sm"}=props;const sizeClass=`size_${size}`;return jsx("div",{className:classnames("layout_item",sizeClass,globalProps(props),className),children:children})};const Header=props=>{const{children:children,className:className}=props;return jsx("div",{className:classnames("layout_header",globalProps(props),className),children:children})};const Footer=props=>{const{children:children,className:className}=props;return jsx("div",{className:classnames("layout_footer",globalProps(props),className),children:children})};const Layout=props=>{const{aria:aria={},children:children,className:className,collapse:collapse="md",dark:dark=false,data:data={},full:full=false,htmlOptions:htmlOptions={},position:position="left",responsive:responsive=false,size:size="md",layout:layout="sidebar",variant:variant="light",transparent:transparent=false}=props;const responsiveClass=responsive?"_responsive":"";const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const layoutCss=layout=="collection"?`pb_layout_kit_${layout}`:layout=="kanban"?`pb_layout_kit_${layout}${responsiveClass}`:buildCss(`pb_layout_kit_${layout}`,`size_${size}`,position,variant,{dark:dark,transparent:transparent,full:full});const layoutCollapseCss=layout=="collection"?"":layout=="kanban"?"":buildCss("layout",position,"collapse",collapse);const layoutChildren=React__default.Children.toArray(children);const subComponentTags=tagName=>layoutChildren.filter((c=>{var _a;return((_a=c.type)==null?void 0:_a.displayName)===tagName})).map(((child,i)=>React__default.cloneElement(child,{key:`${tagName.toLowerCase()}-${i}`})));const nonSideChildren=layoutChildren.filter((child=>{var _a;return((_a=child.type)==null?void 0:_a.displayName)!=="Side"}));const filteredProps={...props};filteredProps==null?true:delete filteredProps.position;return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classnames(layoutCss,layoutCollapseCss,className,globalProps(filteredProps)),children:[subComponentTags("Side"),nonSideChildren]})};Layout.Side=Side;Layout.Body=Body;Layout.Item=Item;Layout.Header=Header;Layout.Footer=Footer;const useKbdControls=api=>{const[cmdKey,setCmdKey]=useState("");useEffect((()=>{const handleKeyDown=({key:key})=>{const keyCmd=key.toLowerCase();setCmdKey(keyCmd);switch(keyCmd){case"escape":{api.onClose();break}case"arrowleft":{api.onArrowLeft();break}case"arrowright":{api.onArrowRight();break}}};window.addEventListener("keydown",handleKeyDown);return()=>{window.removeEventListener("keydown",handleKeyDown)}}),[api]);return cmdKey};const LightboxContext=React__default.createContext({});const LightboxHeader=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},onClickRight:onClickRight,spacing:spacing="between",text:text2,navRight:navRight,title:title,closeable:closeable=true,icon:icon="times"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const api=useContext(LightboxContext);const headerCSS=buildCss("lightbox_header");const headerSpacing=globalProps(props,{paddingY:"sm"});const handleOnLightboxClose=()=>api.onClose();const HeaderBody=()=>jsxs(React__default.Fragment,{children:[jsx(FlexItem,{flex:"1",marginLeft:"sm",children:jsx(CircleIconButton,{dark:true,icon:icon,onClick:handleOnLightboxClose,variant:"link"})}),title&&text2&&jsx(FlexItem,{flex:"5",children:jsx(Flex,{justify:"center",children:jsxs(Flex,{align:"center",orientation:"column",children:[typeof title==="string"?jsx(Title,{dark:true,paddingBottom:"xxs",size:4,text:title}):jsx(Flex,{className:"custom-header",justify:"center",children:title}),typeof text2==="string"?jsx(Caption,{dark:true,children:text2}):jsx(Flex,{className:"custom-header",justify:"center",children:text2})]})})}),jsx(FlexItem,{flex:"1",children:jsx(Flex,{justify:"end",children:jsx(Button,{className:"nav-right-btn",dark:true,htmlType:"button",onClick:onClickRight,text:navRight,variant:"link"})})})]});return jsx("div",{className:"carousel-header",children:jsxs(Flex,{...ariaProps,...dataProps,...htmlProps,className:classnames(headerCSS,headerSpacing,className),spacing:spacing,children:[closeable&&jsx(HeaderBody,{}),children]})})};var roundNumber=function(num,decimal){return Number(num.toFixed(decimal))};var checkIsNumber=function(num,defaultValue){return defaultValue};var handleCallback=function(context,event,callback){if(callback&&typeof callback==="function"){callback(context,event)}};var easeOut=function(t){return-Math.cos(t*Math.PI)/2+.5};var linear=function(t){return t};var easeInQuad=function(t){return t*t};var easeOutQuad=function(t){return t*(2-t)};var easeInOutQuad=function(t){return t<.5?2*t*t:-1+(4-2*t)*t};var easeInCubic=function(t){return t*t*t};var easeOutCubic=function(t){return--t*t*t+1};var easeInOutCubic=function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1};var easeInQuart=function(t){return t*t*t*t};var easeOutQuart=function(t){return 1- --t*t*t*t};var easeInOutQuart=function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t};var easeInQuint=function(t){return t*t*t*t*t};var easeOutQuint=function(t){return 1+--t*t*t*t*t};var easeInOutQuint=function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t};var animations={easeOut:easeOut,linear:linear,easeInQuad:easeInQuad,easeOutQuad:easeOutQuad,easeInOutQuad:easeInOutQuad,easeInCubic:easeInCubic,easeOutCubic:easeOutCubic,easeInOutCubic:easeInOutCubic,easeInQuart:easeInQuart,easeOutQuart:easeOutQuart,easeInOutQuart:easeInOutQuart,easeInQuint:easeInQuint,easeOutQuint:easeOutQuint,easeInOutQuint:easeInOutQuint};var handleCancelAnimationFrame=function(animation){if(typeof animation==="number"){cancelAnimationFrame(animation)}};var handleCancelAnimation=function(contextInstance){if(!contextInstance.mounted)return;handleCancelAnimationFrame(contextInstance.animation);contextInstance.animate=false;contextInstance.animation=null;contextInstance.velocity=null};function handleSetupAnimation(contextInstance,animationName,animationTime,callback){if(!contextInstance.mounted)return;var startTime=(new Date).getTime();var lastStep=1;handleCancelAnimation(contextInstance);contextInstance.animation=function(){if(!contextInstance.mounted){return handleCancelAnimationFrame(contextInstance.animation)}var frameTime=(new Date).getTime()-startTime;var animationProgress=frameTime/animationTime;var animationType=animations[animationName];var step=animationType(animationProgress);if(frameTime>=animationTime){callback(lastStep);contextInstance.animation=null}else if(contextInstance.animation){callback(step);requestAnimationFrame(contextInstance.animation)}};requestAnimationFrame(contextInstance.animation)}function isValidTargetState(targetState){var scale=targetState.scale,positionX=targetState.positionX,positionY=targetState.positionY;if(Number.isNaN(scale)||Number.isNaN(positionX)||Number.isNaN(positionY)){return false}return true}function animate(contextInstance,targetState,animationTime,animationName){var isValid=isValidTargetState(targetState);if(!contextInstance.mounted||!isValid)return;var setTransformState=contextInstance.setTransformState;var _a=contextInstance.transformState,scale=_a.scale,positionX=_a.positionX,positionY=_a.positionY;var scaleDiff=targetState.scale-scale;var positionXDiff=targetState.positionX-positionX;var positionYDiff=targetState.positionY-positionY;if(animationTime===0){setTransformState(targetState.scale,targetState.positionX,targetState.positionY)}else{handleSetupAnimation(contextInstance,animationName,animationTime,(function(step){var newScale=scale+scaleDiff*step;var newPositionX=positionX+positionXDiff*step;var newPositionY=positionY+positionYDiff*step;setTransformState(newScale,newPositionX,newPositionY)}))}}function getComponentsSizes(wrapperComponent,contentComponent,newScale){var wrapperWidth=wrapperComponent.offsetWidth;var wrapperHeight=wrapperComponent.offsetHeight;var contentWidth=contentComponent.offsetWidth;var contentHeight=contentComponent.offsetHeight;var newContentWidth=contentWidth*newScale;var newContentHeight=contentHeight*newScale;var newDiffWidth=wrapperWidth-newContentWidth;var newDiffHeight=wrapperHeight-newContentHeight;return{wrapperWidth:wrapperWidth,wrapperHeight:wrapperHeight,newContentWidth:newContentWidth,newDiffWidth:newDiffWidth,newContentHeight:newContentHeight,newDiffHeight:newDiffHeight}}var getBounds=function(wrapperWidth,newContentWidth,diffWidth,wrapperHeight,newContentHeight,diffHeight,centerZoomedOut){var scaleWidthFactor=wrapperWidth>newContentWidth?diffWidth*(centerZoomedOut?1:.5):0;var scaleHeightFactor=wrapperHeight>newContentHeight?diffHeight*(centerZoomedOut?1:.5):0;var minPositionX=wrapperWidth-newContentWidth-scaleWidthFactor;var maxPositionX=scaleWidthFactor;var minPositionY=wrapperHeight-newContentHeight-scaleHeightFactor;var maxPositionY=scaleHeightFactor;return{minPositionX:minPositionX,maxPositionX:maxPositionX,minPositionY:minPositionY,maxPositionY:maxPositionY}};var calculateBounds=function(contextInstance,newScale){var wrapperComponent=contextInstance.wrapperComponent,contentComponent=contextInstance.contentComponent;var centerZoomedOut=contextInstance.setup.centerZoomedOut;if(!wrapperComponent||!contentComponent){throw new Error("Components are not mounted")}var _a=getComponentsSizes(wrapperComponent,contentComponent,newScale),wrapperWidth=_a.wrapperWidth,wrapperHeight=_a.wrapperHeight,newContentWidth=_a.newContentWidth,newDiffWidth=_a.newDiffWidth,newContentHeight=_a.newContentHeight,newDiffHeight=_a.newDiffHeight;var bounds=getBounds(wrapperWidth,newContentWidth,newDiffWidth,wrapperHeight,newContentHeight,newDiffHeight,Boolean(centerZoomedOut));return bounds};var boundLimiter=function(value,minBound,maxBound,isActive){if(!isActive)return roundNumber(value,2);if(value<minBound)return roundNumber(minBound,2);if(value>maxBound)return roundNumber(maxBound,2);return roundNumber(value,2)};var handleCalculateBounds=function(contextInstance,newScale){var bounds=calculateBounds(contextInstance,newScale);contextInstance.bounds=bounds;return bounds};function getMouseBoundedPosition(positionX,positionY,bounds,limitToBounds,paddingValueX,paddingValueY,wrapperComponent){var minPositionX=bounds.minPositionX,minPositionY=bounds.minPositionY,maxPositionX=bounds.maxPositionX,maxPositionY=bounds.maxPositionY;var paddingX=0;var paddingY=0;if(wrapperComponent){paddingX=paddingValueX;paddingY=paddingValueY}var x=boundLimiter(positionX,minPositionX-paddingX,maxPositionX+paddingX,limitToBounds);var y=boundLimiter(positionY,minPositionY-paddingY,maxPositionY+paddingY,limitToBounds);return{x:x,y:y}}function handleCalculateZoomPositions(contextInstance,mouseX,mouseY,newScale,bounds,limitToBounds){var _a=contextInstance.transformState,scale=_a.scale,positionX=_a.positionX,positionY=_a.positionY;var scaleDifference=newScale-scale;if(typeof mouseX!=="number"||typeof mouseY!=="number"){console.error("Mouse X and Y position were not provided!");return{x:positionX,y:positionY}}var calculatedPositionX=positionX-mouseX*scaleDifference;var calculatedPositionY=positionY-mouseY*scaleDifference;var newPositions=getMouseBoundedPosition(calculatedPositionX,calculatedPositionY,bounds,limitToBounds,0,0,null);return newPositions}function checkZoomBounds(zoom,minScale,maxScale,zoomPadding,enablePadding){var scalePadding=enablePadding?zoomPadding:0;var minScaleWithPadding=minScale-scalePadding;if(!Number.isNaN(maxScale)&&zoom>=maxScale)return maxScale;if(!Number.isNaN(minScale)&&zoom<=minScaleWithPadding)return minScaleWithPadding;return zoom}var isPanningStartAllowed=function(contextInstance,event){var excluded=contextInstance.setup.panning.excluded;var isInitialized=contextInstance.isInitialized,wrapperComponent=contextInstance.wrapperComponent;var target=event.target;var isWrapperChild=wrapperComponent===null||wrapperComponent===void 0?void 0:wrapperComponent.contains(target);var isAllowed=isInitialized&&target&&isWrapperChild;if(!isAllowed)return false;var isExcluded=isExcludedNode(target,excluded);if(isExcluded)return false;return true};var isPanningAllowed=function(contextInstance){var isInitialized=contextInstance.isInitialized,isPanning=contextInstance.isPanning,setup=contextInstance.setup;var disabled=setup.panning.disabled;var isAllowed=isInitialized&&isPanning&&!disabled;if(!isAllowed)return false;return true};var handlePanningSetup=function(contextInstance,event){var _a=contextInstance.transformState,positionX=_a.positionX,positionY=_a.positionY;contextInstance.isPanning=true;var x=event.clientX;var y=event.clientY;contextInstance.startCoords={x:x-positionX,y:y-positionY}};var handleTouchPanningSetup=function(contextInstance,event){var touches=event.touches;var _a=contextInstance.transformState,positionX=_a.positionX,positionY=_a.positionY;contextInstance.isPanning=true;var oneFingerTouch=touches.length===1;if(oneFingerTouch){var x=touches[0].clientX;var y=touches[0].clientY;contextInstance.startCoords={x:x-positionX,y:y-positionY}}};function handlePanToBounds(contextInstance){var _a=contextInstance.transformState,positionX=_a.positionX,positionY=_a.positionY,scale=_a.scale;var _b=contextInstance.setup,disabled=_b.disabled,limitToBounds=_b.limitToBounds,centerZoomedOut=_b.centerZoomedOut;var wrapperComponent=contextInstance.wrapperComponent;if(disabled||!wrapperComponent||!contextInstance.bounds)return;var _c=contextInstance.bounds,maxPositionX=_c.maxPositionX,minPositionX=_c.minPositionX,maxPositionY=_c.maxPositionY,minPositionY=_c.minPositionY;var xChanged=positionX>maxPositionX||positionX<minPositionX;var yChanged=positionY>maxPositionY||positionY<minPositionY;var mousePosX=positionX>maxPositionX?wrapperComponent.offsetWidth:contextInstance.setup.minPositionX||0;var mousePosY=positionY>maxPositionY?wrapperComponent.offsetHeight:contextInstance.setup.minPositionY||0;var _d=handleCalculateZoomPositions(contextInstance,mousePosX,mousePosY,scale,contextInstance.bounds,limitToBounds||centerZoomedOut),x=_d.x,y=_d.y;return{scale:scale,positionX:xChanged?x:positionX,positionY:yChanged?y:positionY}}function handleNewPosition(contextInstance,newPositionX,newPositionY,paddingValueX,paddingValueY){var limitToBounds=contextInstance.setup.limitToBounds;var wrapperComponent=contextInstance.wrapperComponent,bounds=contextInstance.bounds;var _a=contextInstance.transformState,scale=_a.scale,positionX=_a.positionX,positionY=_a.positionY;if(wrapperComponent===null||bounds===null||newPositionX===positionX&&newPositionY===positionY){return}var _b=getMouseBoundedPosition(newPositionX,newPositionY,bounds,limitToBounds,paddingValueX,paddingValueY,wrapperComponent),x=_b.x,y=_b.y;contextInstance.setTransformState(scale,x,y)}var getPanningClientPosition=function(contextInstance,clientX,clientY){var startCoords=contextInstance.startCoords,transformState=contextInstance.transformState;var panning=contextInstance.setup.panning;var lockAxisX=panning.lockAxisX,lockAxisY=panning.lockAxisY;var positionX=transformState.positionX,positionY=transformState.positionY;if(!startCoords){return{x:positionX,y:positionY}}var mouseX=clientX-startCoords.x;var mouseY=clientY-startCoords.y;var newPositionX=lockAxisX?positionX:mouseX;var newPositionY=lockAxisY?positionY:mouseY;return{x:newPositionX,y:newPositionY}};var getPaddingValue=function(contextInstance,size){var setup=contextInstance.setup,transformState=contextInstance.transformState;var scale=transformState.scale;var minScale=setup.minScale,disablePadding=setup.disablePadding;if(size>0&&scale>=minScale&&!disablePadding){return size}return 0};var isVelocityCalculationAllowed=function(contextInstance){var mounted=contextInstance.mounted;var _a=contextInstance.setup,disabled=_a.disabled,velocityAnimation=_a.velocityAnimation;var scale=contextInstance.transformState.scale;var disabledVelocity=velocityAnimation.disabled;var isAllowed=!disabledVelocity||scale>1||!disabled||mounted;if(!isAllowed)return false;return true};var isVelocityAllowed=function(contextInstance){var mounted=contextInstance.mounted,velocity=contextInstance.velocity,bounds=contextInstance.bounds;var _a=contextInstance.setup,disabled=_a.disabled,velocityAnimation=_a.velocityAnimation;var scale=contextInstance.transformState.scale;var disabledVelocity=velocityAnimation.disabled;var isAllowed=!disabledVelocity||scale>1||!disabled||mounted;if(!isAllowed)return false;if(!velocity||!bounds)return false;return true};function getVelocityMoveTime(contextInstance,velocity){var velocityAnimation=contextInstance.setup.velocityAnimation;var equalToMove=velocityAnimation.equalToMove,animationTime=velocityAnimation.animationTime,sensitivity=velocityAnimation.sensitivity;if(equalToMove){return animationTime*velocity*sensitivity}return animationTime}function getVelocityPosition(newPosition,startPosition,currentPosition,isLocked,limitToBounds,minPosition,maxPosition,minTarget,maxTarget,step){if(limitToBounds){if(startPosition>maxPosition&¤tPosition>maxPosition){var calculatedPosition=maxPosition+(newPosition-maxPosition)*step;if(calculatedPosition>maxTarget)return maxTarget;if(calculatedPosition<maxPosition)return maxPosition;return calculatedPosition}if(startPosition<minPosition&¤tPosition<minPosition){var calculatedPosition=minPosition+(newPosition-minPosition)*step;if(calculatedPosition<minTarget)return minTarget;if(calculatedPosition>minPosition)return minPosition;return calculatedPosition}}if(isLocked)return startPosition;return boundLimiter(newPosition,minPosition,maxPosition,limitToBounds)}function getSizeMultiplier(wrapperComponent,equalToMove){var defaultMultiplier=1;if(equalToMove){return Math.min(defaultMultiplier,wrapperComponent.offsetWidth/window.innerWidth)}return defaultMultiplier}function handleCalculateVelocity(contextInstance,position){var isAllowed=isVelocityCalculationAllowed(contextInstance);if(!isAllowed){return}var lastMousePosition=contextInstance.lastMousePosition,velocityTime=contextInstance.velocityTime,setup=contextInstance.setup;var wrapperComponent=contextInstance.wrapperComponent;var equalToMove=setup.velocityAnimation.equalToMove;var now=Date.now();if(lastMousePosition&&velocityTime&&wrapperComponent){var sizeMultiplier=getSizeMultiplier(wrapperComponent,equalToMove);var distanceX=position.x-lastMousePosition.x;var distanceY=position.y-lastMousePosition.y;var velocityX=distanceX/sizeMultiplier;var velocityY=distanceY/sizeMultiplier;var interval=now-velocityTime;var speed=distanceX*distanceX+distanceY*distanceY;var velocity=Math.sqrt(speed)/interval;contextInstance.velocity={velocityX:velocityX,velocityY:velocityY,total:velocity}}contextInstance.lastMousePosition=position;contextInstance.velocityTime=now}function handleVelocityPanning(contextInstance){var velocity=contextInstance.velocity,bounds=contextInstance.bounds,setup=contextInstance.setup,wrapperComponent=contextInstance.wrapperComponent;var isAllowed=isVelocityAllowed(contextInstance);if(!isAllowed||!velocity||!bounds||!wrapperComponent){return}var velocityX=velocity.velocityX,velocityY=velocity.velocityY,total=velocity.total;var maxPositionX=bounds.maxPositionX,minPositionX=bounds.minPositionX,maxPositionY=bounds.maxPositionY,minPositionY=bounds.minPositionY;var limitToBounds=setup.limitToBounds,alignmentAnimation=setup.alignmentAnimation;var zoomAnimation=setup.zoomAnimation,panning=setup.panning;var lockAxisY=panning.lockAxisY,lockAxisX=panning.lockAxisX;var animationType=zoomAnimation.animationType;var sizeX=alignmentAnimation.sizeX,sizeY=alignmentAnimation.sizeY,velocityAlignmentTime=alignmentAnimation.velocityAlignmentTime;var alignAnimationTime=velocityAlignmentTime;var moveAnimationTime=getVelocityMoveTime(contextInstance,total);var finalAnimationTime=Math.max(moveAnimationTime,alignAnimationTime);var paddingValueX=getPaddingValue(contextInstance,sizeX);var paddingValueY=getPaddingValue(contextInstance,sizeY);var paddingX=paddingValueX*wrapperComponent.offsetWidth/100;var paddingY=paddingValueY*wrapperComponent.offsetHeight/100;var maxTargetX=maxPositionX+paddingX;var minTargetX=minPositionX-paddingX;var maxTargetY=maxPositionY+paddingY;var minTargetY=minPositionY-paddingY;var startState=contextInstance.transformState;var startTime=(new Date).getTime();handleSetupAnimation(contextInstance,animationType,finalAnimationTime,(function(step){var _a=contextInstance.transformState,scale=_a.scale,positionX=_a.positionX,positionY=_a.positionY;var frameTime=(new Date).getTime()-startTime;var animationProgress=frameTime/alignAnimationTime;var alignAnimation=animations[alignmentAnimation.animationType];var alignStep=1-alignAnimation(Math.min(1,animationProgress));var customStep=1-step;var newPositionX=positionX+velocityX*customStep;var newPositionY=positionY+velocityY*customStep;var currentPositionX=getVelocityPosition(newPositionX,startState.positionX,positionX,lockAxisX,limitToBounds,minPositionX,maxPositionX,minTargetX,maxTargetX,alignStep);var currentPositionY=getVelocityPosition(newPositionY,startState.positionY,positionY,lockAxisY,limitToBounds,minPositionY,maxPositionY,minTargetY,maxTargetY,alignStep);if(positionX!==newPositionX||positionY!==newPositionY){contextInstance.setTransformState(scale,currentPositionX,currentPositionY)}}))}function handlePanningStart(contextInstance,event){var scale=contextInstance.transformState.scale;handleCancelAnimation(contextInstance);handleCalculateBounds(contextInstance,scale);if(window.TouchEvent!==void 0&&event instanceof TouchEvent){handleTouchPanningSetup(contextInstance,event)}else{handlePanningSetup(contextInstance,event)}}function handleAlignToBounds(contextInstance){var scale=contextInstance.transformState.scale;var _a=contextInstance.setup,minScale=_a.minScale,alignmentAnimation=_a.alignmentAnimation;var disabled=alignmentAnimation.disabled,sizeX=alignmentAnimation.sizeX,sizeY=alignmentAnimation.sizeY,animationTime=alignmentAnimation.animationTime,animationType=alignmentAnimation.animationType;var isDisabled=disabled||scale<minScale||!sizeX&&!sizeY;if(isDisabled)return;var targetState=handlePanToBounds(contextInstance);if(targetState){animate(contextInstance,targetState,animationTime,animationType)}}function handlePanning(contextInstance,clientX,clientY){var startCoords=contextInstance.startCoords,setup=contextInstance.setup;var _a=setup.alignmentAnimation,sizeX=_a.sizeX,sizeY=_a.sizeY;if(!startCoords)return;var _b=getPanningClientPosition(contextInstance,clientX,clientY),x=_b.x,y=_b.y;var paddingValueX=getPaddingValue(contextInstance,sizeX);var paddingValueY=getPaddingValue(contextInstance,sizeY);handleCalculateVelocity(contextInstance,{x:x,y:y});handleNewPosition(contextInstance,x,y,paddingValueX,paddingValueY)}function handlePanningEnd(contextInstance){if(contextInstance.isPanning){var velocityDisabled=contextInstance.setup.panning.velocityDisabled;var velocity=contextInstance.velocity,wrapperComponent=contextInstance.wrapperComponent,contentComponent=contextInstance.contentComponent;contextInstance.isPanning=false;contextInstance.animate=false;contextInstance.animation=null;var wrapperRect=wrapperComponent===null||wrapperComponent===void 0?void 0:wrapperComponent.getBoundingClientRect();var contentRect=contentComponent===null||contentComponent===void 0?void 0:contentComponent.getBoundingClientRect();var wrapperWidth=(wrapperRect===null||wrapperRect===void 0?void 0:wrapperRect.width)||0;var wrapperHeight=(wrapperRect===null||wrapperRect===void 0?void 0:wrapperRect.height)||0;var contentWidth=(contentRect===null||contentRect===void 0?void 0:contentRect.width)||0;var contentHeight=(contentRect===null||contentRect===void 0?void 0:contentRect.height)||0;var isZoomed=wrapperWidth<contentWidth||wrapperHeight<contentHeight;var shouldAnimate=!velocityDisabled&&velocity&&(velocity===null||velocity===void 0?void 0:velocity.total)>.1&&isZoomed;if(shouldAnimate){handleVelocityPanning(contextInstance)}else{handleAlignToBounds(contextInstance)}}}function handleZoomToPoint(contextInstance,scale,mouseX,mouseY){var _a=contextInstance.setup,minScale=_a.minScale,maxScale=_a.maxScale,limitToBounds=_a.limitToBounds;var newScale=checkZoomBounds(roundNumber(scale,2),minScale,maxScale,0,false);var bounds=handleCalculateBounds(contextInstance,newScale);var _b=handleCalculateZoomPositions(contextInstance,mouseX,mouseY,newScale,bounds,limitToBounds),x=_b.x,y=_b.y;return{scale:newScale,positionX:x,positionY:y}}function handleAlignToScaleBounds(contextInstance,mousePositionX,mousePositionY){var scale=contextInstance.transformState.scale;var wrapperComponent=contextInstance.wrapperComponent;var _a=contextInstance.setup,minScale=_a.minScale,limitToBounds=_a.limitToBounds,zoomAnimation=_a.zoomAnimation;var disabled=zoomAnimation.disabled,animationTime=zoomAnimation.animationTime,animationType=zoomAnimation.animationType;var isDisabled=disabled||scale>=minScale;if(scale>=1||limitToBounds){handleAlignToBounds(contextInstance)}if(isDisabled||!wrapperComponent||!contextInstance.mounted)return;var mouseX=mousePositionX||wrapperComponent.offsetWidth/2;var mouseY=mousePositionY||wrapperComponent.offsetHeight/2;var targetState=handleZoomToPoint(contextInstance,minScale,mouseX,mouseY);if(targetState){animate(contextInstance,targetState,animationTime,animationType)}}var __assign=function(){__assign=Object.assign||function __assign2(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};return __assign.apply(this,arguments)};function __spreadArray(to,from,pack){for(var i=0,l=from.length,ar;i<l;i++){if(ar||!(i in from)){if(!ar)ar=Array.prototype.slice.call(from,0,i);ar[i]=from[i]}}return to.concat(ar||Array.prototype.slice.call(from))}var initialState={previousScale:1,scale:1,positionX:0,positionY:0};var initialSetup={disabled:false,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:true,centerZoomedOut:false,centerOnInit:false,disablePadding:false,wheel:{step:.2,disabled:false,wheelDisabled:false,touchPadDisabled:false,activationKeys:[],excluded:[]},panning:{disabled:false,velocityDisabled:false,lockAxisX:false,lockAxisY:false,activationKeys:[],excluded:[]},pinch:{step:5,disabled:false,excluded:[]},doubleClick:{disabled:false,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:false,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:false,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:false,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:true}};var createState=function(props){var _a,_b,_c,_d;return{previousScale:(_a=props.initialScale)!==null&&_a!==void 0?_a:initialState.scale,scale:(_b=props.initialScale)!==null&&_b!==void 0?_b:initialState.scale,positionX:(_c=props.initialPositionX)!==null&&_c!==void 0?_c:initialState.positionX,positionY:(_d=props.initialPositionY)!==null&&_d!==void 0?_d:initialState.positionY}};var createSetup=function(props){var newSetup=__assign({},initialSetup);Object.keys(props).forEach((function(key){var validValue=typeof props[key]!=="undefined";var validParameter=typeof initialSetup[key]!=="undefined";if(validParameter&&validValue){var dataType=Object.prototype.toString.call(initialSetup[key]);var isObject2=dataType==="[object Object]";var isArray=dataType==="[object Array]";if(isObject2){newSetup[key]=__assign(__assign({},initialSetup[key]),props[key])}else if(isArray){newSetup[key]=__spreadArray(__spreadArray([],initialSetup[key],true),props[key])}else{newSetup[key]=props[key]}}}));return newSetup};var handleCalculateButtonZoom=function(contextInstance,delta,step){var scale=contextInstance.transformState.scale;var wrapperComponent=contextInstance.wrapperComponent,setup=contextInstance.setup;var maxScale=setup.maxScale,minScale=setup.minScale,zoomAnimation=setup.zoomAnimation;var size=zoomAnimation.size;if(!wrapperComponent){throw new Error("Wrapper is not mounted")}var targetScale=scale*Math.exp(delta*step);var newScale=checkZoomBounds(roundNumber(targetScale,3),minScale,maxScale,size,false);return newScale};function handleZoomToViewCenter(contextInstance,delta,step,animationTime,animationType){var wrapperComponent=contextInstance.wrapperComponent;var _a=contextInstance.transformState,scale=_a.scale,positionX=_a.positionX,positionY=_a.positionY;if(!wrapperComponent)return console.error("No WrapperComponent found");var wrapperWidth=wrapperComponent.offsetWidth;var wrapperHeight=wrapperComponent.offsetHeight;var mouseX=(wrapperWidth/2-positionX)/scale;var mouseY=(wrapperHeight/2-positionY)/scale;var newScale=handleCalculateButtonZoom(contextInstance,delta,step);var targetState=handleZoomToPoint(contextInstance,newScale,mouseX,mouseY);if(!targetState){return console.error("Error during zoom event. New transformation state was not calculated.")}animate(contextInstance,targetState,animationTime,animationType)}function resetTransformations(contextInstance,animationTime,animationType,onResetTransformation){var setup=contextInstance.setup,wrapperComponent=contextInstance.wrapperComponent;var limitToBounds=setup.limitToBounds;var initialTransformation=createState(contextInstance.props);var _a=contextInstance.transformState,scale=_a.scale,positionX=_a.positionX,positionY=_a.positionY;if(!wrapperComponent)return;var newBounds=calculateBounds(contextInstance,initialTransformation.scale);var boundedPositions=getMouseBoundedPosition(initialTransformation.positionX,initialTransformation.positionY,newBounds,limitToBounds,0,0,wrapperComponent);var newState={scale:initialTransformation.scale,positionX:boundedPositions.x,positionY:boundedPositions.y};if(scale===initialTransformation.scale&&positionX===initialTransformation.positionX&&positionY===initialTransformation.positionY){return}onResetTransformation===null||onResetTransformation===void 0?void 0:onResetTransformation();animate(contextInstance,newState,animationTime,animationType)}function getOffset(element,wrapper,content,state){var offset2=element.getBoundingClientRect();var wrapperOffset=wrapper.getBoundingClientRect();var contentOffset=content.getBoundingClientRect();var xOff=wrapperOffset.x*state.scale;var yOff=wrapperOffset.y*state.scale;return{x:(offset2.x-contentOffset.x+xOff)/state.scale,y:(offset2.y-contentOffset.y+yOff)/state.scale}}function calculateZoomToNode(contextInstance,node,customZoom){var wrapperComponent=contextInstance.wrapperComponent,contentComponent=contextInstance.contentComponent,transformState=contextInstance.transformState;var _a=contextInstance.setup,limitToBounds=_a.limitToBounds,minScale=_a.minScale,maxScale=_a.maxScale;if(!wrapperComponent||!contentComponent)return transformState;var wrapperRect=wrapperComponent.getBoundingClientRect();var nodeRect=node.getBoundingClientRect();var nodeOffset=getOffset(node,wrapperComponent,contentComponent,transformState);var nodeLeft=nodeOffset.x;var nodeTop=nodeOffset.y;var nodeWidth=nodeRect.width/transformState.scale;var nodeHeight=nodeRect.height/transformState.scale;var scaleX=wrapperComponent.offsetWidth/nodeWidth;var scaleY=wrapperComponent.offsetHeight/nodeHeight;var newScale=checkZoomBounds(customZoom||Math.min(scaleX,scaleY),minScale,maxScale,0,false);var offsetX=(wrapperRect.width-nodeWidth*newScale)/2;var offsetY=(wrapperRect.height-nodeHeight*newScale)/2;var newPositionX=(wrapperRect.left-nodeLeft)*newScale+offsetX;var newPositionY=(wrapperRect.top-nodeTop)*newScale+offsetY;var bounds=calculateBounds(contextInstance,newScale);var _b=getMouseBoundedPosition(newPositionX,newPositionY,bounds,limitToBounds,0,0,wrapperComponent),x=_b.x,y=_b.y;return{positionX:x,positionY:y,scale:newScale}}var zoomIn=function(contextInstance){return function(step,animationTime,animationType){if(step===void 0){step=.5}if(animationTime===void 0){animationTime=300}if(animationType===void 0){animationType="easeOut"}handleZoomToViewCenter(contextInstance,1,step,animationTime,animationType)}};var zoomOut=function(contextInstance){return function(step,animationTime,animationType){if(step===void 0){step=.5}if(animationTime===void 0){animationTime=300}if(animationType===void 0){animationType="easeOut"}handleZoomToViewCenter(contextInstance,-1,step,animationTime,animationType)}};var setTransform=function(contextInstance){return function(newPositionX,newPositionY,newScale,animationTime,animationType){if(animationTime===void 0){animationTime=300}if(animationType===void 0){animationType="easeOut"}var _a=contextInstance.transformState,positionX=_a.positionX,positionY=_a.positionY,scale=_a.scale;var wrapperComponent=contextInstance.wrapperComponent,contentComponent=contextInstance.contentComponent;var disabled=contextInstance.setup.disabled;if(disabled||!wrapperComponent||!contentComponent)return;var targetState={positionX:Number.isNaN(newPositionX)?positionX:newPositionX,positionY:Number.isNaN(newPositionY)?positionY:newPositionY,scale:Number.isNaN(newScale)?scale:newScale};animate(contextInstance,targetState,animationTime,animationType)}};var resetTransform=function(contextInstance){return function(animationTime,animationType){if(animationTime===void 0){animationTime=200}if(animationType===void 0){animationType="easeOut"}resetTransformations(contextInstance,animationTime,animationType)}};var centerView=function(contextInstance){return function(scale,animationTime,animationType){if(animationTime===void 0){animationTime=200}if(animationType===void 0){animationType="easeOut"}var transformState=contextInstance.transformState,wrapperComponent=contextInstance.wrapperComponent,contentComponent=contextInstance.contentComponent;if(wrapperComponent&&contentComponent){var targetState=getCenterPosition(scale||transformState.scale,wrapperComponent,contentComponent);animate(contextInstance,targetState,animationTime,animationType)}}};var zoomToElement=function(contextInstance){return function(node,scale,animationTime,animationType){if(animationTime===void 0){animationTime=600}if(animationType===void 0){animationType="easeOut"}handleCancelAnimation(contextInstance);var wrapperComponent=contextInstance.wrapperComponent;var target=typeof node==="string"?document.getElementById(node):node;if(wrapperComponent&&target&&wrapperComponent.contains(target)){var targetState=calculateZoomToNode(contextInstance,target,scale);animate(contextInstance,targetState,animationTime,animationType)}}};var getContext=function(contextInstance){return{instance:contextInstance,state:contextInstance.transformState,zoomIn:zoomIn(contextInstance),zoomOut:zoomOut(contextInstance),setTransform:setTransform(contextInstance),resetTransform:resetTransform(contextInstance),centerView:centerView(contextInstance),zoomToElement:zoomToElement(contextInstance)}};var passiveSupported=false;function makePassiveEventOption(){try{var options={get passive(){passiveSupported=true;return false}};return options}catch(err){passiveSupported=false;return passiveSupported}}var isExcludedNode=function(node,excluded){var targetTagName=node.tagName.toUpperCase();var isExcludedTag=excluded.find((function(tag){return tag.toUpperCase()===targetTagName}));if(isExcludedTag)return true;var isExcludedClassName=excluded.find((function(className){return node.classList.contains(className)}));if(isExcludedClassName)return true;return false};var cancelTimeout=function(timeout){if(timeout){clearTimeout(timeout)}};var getTransformStyles=function(x,y,scale){return"translate(".concat(x,"px, ").concat(y,"px) scale(").concat(scale,")")};var getCenterPosition=function(scale,wrapperComponent,contentComponent){var contentWidth=contentComponent.offsetWidth*scale;var contentHeight=contentComponent.offsetHeight*scale;var centerPositionX=(wrapperComponent.offsetWidth-contentWidth)/2;var centerPositionY=(wrapperComponent.offsetHeight-contentHeight)/2;return{scale:scale,positionX:centerPositionX,positionY:centerPositionY}};function mergeRefs(refs){return function(value){refs.forEach((function(ref){if(typeof ref==="function"){ref(value)}else if(ref!=null){ref.current=value}}))}}var isWheelAllowed=function(contextInstance,event){var _a=contextInstance.setup.wheel,disabled=_a.disabled,wheelDisabled=_a.wheelDisabled,touchPadDisabled=_a.touchPadDisabled,excluded=_a.excluded;var isInitialized=contextInstance.isInitialized,isPanning=contextInstance.isPanning;var target=event.target;var isAllowed=isInitialized&&!isPanning&&!disabled&⌖if(!isAllowed)return false;if(wheelDisabled&&!event.ctrlKey)return false;if(touchPadDisabled&&event.ctrlKey)return false;var isExcluded=isExcludedNode(target,excluded);if(isExcluded)return false;return true};var getDeltaY=function(event){if(event){return event.deltaY<0?1:-1}return 0};function getDelta(event,customDelta){var deltaY=getDeltaY(event);var delta=checkIsNumber(customDelta,deltaY);return delta}function getMousePosition(event,contentComponent,scale){var contentRect=contentComponent.getBoundingClientRect();var mouseX=0;var mouseY=0;if("clientX"in event){mouseX=(event.clientX-contentRect.left)/scale;mouseY=(event.clientY-contentRect.top)/scale}else{var touch=event.touches[0];mouseX=(touch.clientX-contentRect.left)/scale;mouseY=(touch.clientY-contentRect.top)/scale}if(Number.isNaN(mouseX)||Number.isNaN(mouseY))console.error("No mouse or touch offset found");return{x:mouseX,y:mouseY}}var handleCalculateWheelZoom=function(contextInstance,delta,step,disable,getTarget){var scale=contextInstance.transformState.scale;var wrapperComponent=contextInstance.wrapperComponent,setup=contextInstance.setup;var maxScale=setup.maxScale,minScale=setup.minScale,zoomAnimation=setup.zoomAnimation,disablePadding=setup.disablePadding;var size=zoomAnimation.size,disabled=zoomAnimation.disabled;if(!wrapperComponent){throw new Error("Wrapper is not mounted")}var targetScale=scale+delta*(scale-scale*step)*step;var paddingEnabled=disable?false:!disabled;var newScale=checkZoomBounds(roundNumber(targetScale,3),minScale,maxScale,size,paddingEnabled&&!disablePadding);return newScale};var handleWheelZoomStop=function(contextInstance,event){var previousWheelEvent=contextInstance.previousWheelEvent;var scale=contextInstance.transformState.scale;var _a=contextInstance.setup,maxScale=_a.maxScale,minScale=_a.minScale;if(!previousWheelEvent)return false;if(scale<maxScale||scale>minScale)return true;if(Math.sign(previousWheelEvent.deltaY)!==Math.sign(event.deltaY))return true;if(previousWheelEvent.deltaY>0&&previousWheelEvent.deltaY<event.deltaY)return true;if(previousWheelEvent.deltaY<0&&previousWheelEvent.deltaY>event.deltaY)return true;if(Math.sign(previousWheelEvent.deltaY)!==Math.sign(event.deltaY))return true;return false};var isPinchStartAllowed=function(contextInstance,event){var _a=contextInstance.setup.pinch,disabled=_a.disabled,excluded=_a.excluded;var isInitialized=contextInstance.isInitialized;var target=event.target;var isAllowed=isInitialized&&!disabled&⌖if(!isAllowed)return false;var isExcluded=isExcludedNode(target,excluded);if(isExcluded)return false;return true};var isPinchAllowed=function(contextInstance){var disabled=contextInstance.setup.pinch.disabled;var isInitialized=contextInstance.isInitialized,pinchStartDistance=contextInstance.pinchStartDistance;var isAllowed=isInitialized&&!disabled&&pinchStartDistance;if(!isAllowed)return false;return true};var calculateTouchMidPoint=function(event,scale,contentComponent){var contentRect=contentComponent.getBoundingClientRect();var touches=event.touches;var firstPointX=roundNumber(touches[0].clientX-contentRect.left,5);var firstPointY=roundNumber(touches[0].clientY-contentRect.top,5);var secondPointX=roundNumber(touches[1].clientX-contentRect.left,5);var secondPointY=roundNumber(touches[1].clientY-contentRect.top,5);return{x:(firstPointX+secondPointX)/2/scale,y:(firstPointY+secondPointY)/2/scale}};var getTouchDistance=function(event){return Math.sqrt(Math.pow(event.touches[0].pageX-event.touches[1].pageX,2)+Math.pow(event.touches[0].pageY-event.touches[1].pageY,2))};var calculatePinchZoom=function(contextInstance,currentDistance){var pinchStartScale=contextInstance.pinchStartScale,pinchStartDistance=contextInstance.pinchStartDistance,setup=contextInstance.setup;var maxScale=setup.maxScale,minScale=setup.minScale,zoomAnimation=setup.zoomAnimation,disablePadding=setup.disablePadding;var size=zoomAnimation.size,disabled=zoomAnimation.disabled;if(!pinchStartScale||pinchStartDistance===null||!currentDistance){throw new Error("Pinch touches distance was not provided")}if(currentDistance<0){return contextInstance.transformState.scale}var touchProportion=currentDistance/pinchStartDistance;var scaleDifference=touchProportion*pinchStartScale;return checkZoomBounds(roundNumber(scaleDifference,2),minScale,maxScale,size,!disabled&&!disablePadding)};var wheelStopEventTime=160;var wheelAnimationTime=100;var handleWheelStart=function(contextInstance,event){var _a=contextInstance.props,onWheelStart=_a.onWheelStart,onZoomStart=_a.onZoomStart;if(!contextInstance.wheelStopEventTimer){handleCancelAnimation(contextInstance);handleCallback(getContext(contextInstance),event,onWheelStart);handleCallback(getContext(contextInstance),event,onZoomStart)}};var handleWheelZoom=function(contextInstance,event){var _a=contextInstance.props,onWheel=_a.onWheel,onZoom=_a.onZoom;var contentComponent=contextInstance.contentComponent,setup=contextInstance.setup,transformState=contextInstance.transformState;var scale=transformState.scale;var limitToBounds=setup.limitToBounds,centerZoomedOut=setup.centerZoomedOut,zoomAnimation=setup.zoomAnimation,wheel=setup.wheel,disablePadding=setup.disablePadding;var size=zoomAnimation.size,disabled=zoomAnimation.disabled;var step=wheel.step;if(!contentComponent){throw new Error("Component not mounted")}event.preventDefault();event.stopPropagation();var delta=getDelta(event,null);var newScale=handleCalculateWheelZoom(contextInstance,delta,step,!event.ctrlKey);if(scale===newScale)return;var bounds=handleCalculateBounds(contextInstance,newScale);var mousePosition=getMousePosition(event,contentComponent,scale);var isPaddingDisabled=disabled||size===0||centerZoomedOut||disablePadding;var isLimitedToBounds=limitToBounds&&isPaddingDisabled;var _b=handleCalculateZoomPositions(contextInstance,mousePosition.x,mousePosition.y,newScale,bounds,isLimitedToBounds),x=_b.x,y=_b.y;contextInstance.previousWheelEvent=event;contextInstance.setTransformState(newScale,x,y);handleCallback(getContext(contextInstance),event,onWheel);handleCallback(getContext(contextInstance),event,onZoom)};var handleWheelStop=function(contextInstance,event){var _a=contextInstance.props,onWheelStop=_a.onWheelStop,onZoomStop=_a.onZoomStop;cancelTimeout(contextInstance.wheelAnimationTimer);contextInstance.wheelAnimationTimer=setTimeout((function(){if(!contextInstance.mounted)return;handleAlignToScaleBounds(contextInstance,event.x,event.y);contextInstance.wheelAnimationTimer=null}),wheelAnimationTime);var hasStoppedZooming=handleWheelZoomStop(contextInstance,event);if(hasStoppedZooming){cancelTimeout(contextInstance.wheelStopEventTimer);contextInstance.wheelStopEventTimer=setTimeout((function(){if(!contextInstance.mounted)return;contextInstance.wheelStopEventTimer=null;handleCallback(getContext(contextInstance),event,onWheelStop);handleCallback(getContext(contextInstance),event,onZoomStop)}),wheelStopEventTime)}};var handlePinchStart=function(contextInstance,event){var distance=getTouchDistance(event);contextInstance.pinchStartDistance=distance;contextInstance.lastDistance=distance;contextInstance.pinchStartScale=contextInstance.transformState.scale;contextInstance.isPanning=false;handleCancelAnimation(contextInstance)};var handlePinchZoom=function(contextInstance,event){var contentComponent=contextInstance.contentComponent,pinchStartDistance=contextInstance.pinchStartDistance;var scale=contextInstance.transformState.scale;var _a=contextInstance.setup,limitToBounds=_a.limitToBounds,centerZoomedOut=_a.centerZoomedOut,zoomAnimation=_a.zoomAnimation;var disabled=zoomAnimation.disabled,size=zoomAnimation.size;if(pinchStartDistance===null||!contentComponent)return;var midPoint=calculateTouchMidPoint(event,scale,contentComponent);if(!Number.isFinite(midPoint.x)||!Number.isFinite(midPoint.y))return;var currentDistance=getTouchDistance(event);var newScale=calculatePinchZoom(contextInstance,currentDistance);if(newScale===scale)return;var bounds=handleCalculateBounds(contextInstance,newScale);var isPaddingDisabled=disabled||size===0||centerZoomedOut;var isLimitedToBounds=limitToBounds&&isPaddingDisabled;var _b=handleCalculateZoomPositions(contextInstance,midPoint.x,midPoint.y,newScale,bounds,isLimitedToBounds),x=_b.x,y=_b.y;contextInstance.pinchMidpoint=midPoint;contextInstance.lastDistance=currentDistance;contextInstance.setTransformState(newScale,x,y)};var handlePinchStop=function(contextInstance){var pinchMidpoint=contextInstance.pinchMidpoint;contextInstance.velocity=null;contextInstance.lastDistance=null;contextInstance.pinchMidpoint=null;contextInstance.pinchStartScale=null;contextInstance.pinchStartDistance=null;handleAlignToScaleBounds(contextInstance,pinchMidpoint===null||pinchMidpoint===void 0?void 0:pinchMidpoint.x,pinchMidpoint===null||pinchMidpoint===void 0?void 0:pinchMidpoint.y)};var handleDoubleClickStop=function(contextInstance,event){var onZoomStop=contextInstance.props.onZoomStop;var animationTime=contextInstance.setup.doubleClick.animationTime;cancelTimeout(contextInstance.doubleClickStopEventTimer);contextInstance.doubleClickStopEventTimer=setTimeout((function(){contextInstance.doubleClickStopEventTimer=null;handleCallback(getContext(contextInstance),event,onZoomStop)}),animationTime)};var handleDoubleClickResetMode=function(contextInstance,event){var _a=contextInstance.props,onZoomStart=_a.onZoomStart,onZoom=_a.onZoom;var _b=contextInstance.setup.doubleClick,animationTime=_b.animationTime,animationType=_b.animationType;handleCallback(getContext(contextInstance),event,onZoomStart);resetTransformations(contextInstance,animationTime,animationType,(function(){return handleCallback(getContext(contextInstance),event,onZoom)}));handleDoubleClickStop(contextInstance,event)};function handleDoubleClick(contextInstance,event){var setup=contextInstance.setup,doubleClickStopEventTimer=contextInstance.doubleClickStopEventTimer,transformState=contextInstance.transformState,contentComponent=contextInstance.contentComponent;var scale=transformState.scale;var _a=contextInstance.props,onZoomStart=_a.onZoomStart,onZoom=_a.onZoom;var _b=setup.doubleClick,disabled=_b.disabled,mode=_b.mode,step=_b.step,animationTime=_b.animationTime,animationType=_b.animationType;if(disabled)return;if(doubleClickStopEventTimer)return;if(mode==="reset"){return handleDoubleClickResetMode(contextInstance,event)}if(!contentComponent)return console.error("No ContentComponent found");var delta=mode==="zoomOut"?-1:1;var newScale=handleCalculateButtonZoom(contextInstance,delta,step);if(scale===newScale)return;handleCallback(getContext(contextInstance),event,onZoomStart);var mousePosition=getMousePosition(event,contentComponent,scale);var targetState=handleZoomToPoint(contextInstance,newScale,mousePosition.x,mousePosition.y);if(!targetState){return console.error("Error during zoom event. New transformation state was not calculated.")}handleCallback(getContext(contextInstance),event,onZoom);animate(contextInstance,targetState,animationTime,animationType);handleDoubleClickStop(contextInstance,event)}var isDoubleClickAllowed=function(contextInstance,event){var isInitialized=contextInstance.isInitialized,setup=contextInstance.setup,wrapperComponent=contextInstance.wrapperComponent;var _a=setup.doubleClick,disabled=_a.disabled,excluded=_a.excluded;var target=event.target;var isWrapperChild=wrapperComponent===null||wrapperComponent===void 0?void 0:wrapperComponent.contains(target);var isAllowed=isInitialized&&target&&isWrapperChild&&!disabled;if(!isAllowed)return false;var isExcluded=isExcludedNode(target,excluded);if(isExcluded)return false;return true};var ZoomPanPinch=function(){function ZoomPanPinch2(props){var _this=this;this.mounted=true;this.onChangeCallbacks=new Set;this.wrapperComponent=null;this.contentComponent=null;this.isInitialized=false;this.bounds=null;this.previousWheelEvent=null;this.wheelStopEventTimer=null;this.wheelAnimationTimer=null;this.isPanning=false;this.startCoords=null;this.lastTouch=null;this.distance=null;this.lastDistance=null;this.pinchStartDistance=null;this.pinchStartScale=null;this.pinchMidpoint=null;this.doubleClickStopEventTimer=null;this.velocity=null;this.velocityTime=null;this.lastMousePosition=null;this.animate=false;this.animation=null;this.maxBounds=null;this.pressedKeys={};this.mount=function(){_this.initializeWindowEvents()};this.unmount=function(){_this.cleanupWindowEvents()};this.update=function(newProps){handleCalculateBounds(_this,_this.transformState.scale);_this.setup=createSetup(newProps)};this.initializeWindowEvents=function(){var _a;var passive=makePassiveEventOption();var currentDocument=(_a=_this.wrapperComponent)===null||_a===void 0?void 0:_a.ownerDocument;var currentWindow=currentDocument===null||currentDocument===void 0?void 0:currentDocument.defaultView;currentWindow===null||currentWindow===void 0?void 0:currentWindow.addEventListener("mousedown",_this.onPanningStart,passive);currentWindow===null||currentWindow===void 0?void 0:currentWindow.addEventListener("mousemove",_this.onPanning,passive);currentWindow===null||currentWindow===void 0?void 0:currentWindow.addEventListener("mouseup",_this.onPanningStop,passive);currentDocument===null||currentDocument===void 0?void 0:currentDocument.addEventListener("mouseleave",_this.clearPanning,passive);currentWindow===null||currentWindow===void 0?void 0:currentWindow.addEventListener("keyup",_this.setKeyUnPressed,passive);currentWindow===null||currentWindow===void 0?void 0:currentWindow.addEventListener("keydown",_this.setKeyPressed,passive)};this.cleanupWindowEvents=function(){var _a,_b;var passive=makePassiveEventOption();var currentDocument=(_a=_this.wrapperComponent)===null||_a===void 0?void 0:_a.ownerDocument;var currentWindow=currentDocument===null||currentDocument===void 0?void 0:currentDocument.defaultView;currentWindow===null||currentWindow===void 0?void 0:currentWindow.removeEventListener("mousedown",_this.onPanningStart,passive);currentWindow===null||currentWindow===void 0?void 0:currentWindow.removeEventListener("mousemove",_this.onPanning,passive);currentWindow===null||currentWindow===void 0?void 0:currentWindow.removeEventListener("mouseup",_this.onPanningStop,passive);currentDocument===null||currentDocument===void 0?void 0:currentDocument.removeEventListener("mouseleave",_this.clearPanning,passive);currentWindow===null||currentWindow===void 0?void 0:currentWindow.removeEventListener("keyup",_this.setKeyUnPressed,passive);currentWindow===null||currentWindow===void 0?void 0:currentWindow.removeEventListener("keydown",_this.setKeyPressed,passive);document.removeEventListener("mouseleave",_this.clearPanning,passive);handleCancelAnimation(_this);(_b=_this.observer)===null||_b===void 0?void 0:_b.disconnect()};this.handleInitializeWrapperEvents=function(wrapper){var passive=makePassiveEventOption();wrapper.addEventListener("wheel",_this.onWheelZoom,passive);wrapper.addEventListener("dblclick",_this.onDoubleClick,passive);wrapper.addEventListener("touchstart",_this.onTouchPanningStart,passive);wrapper.addEventListener("touchmove",_this.onTouchPanning,passive);wrapper.addEventListener("touchend",_this.onTouchPanningStop,passive)};this.handleInitialize=function(contentComponent){var centerOnInit=_this.setup.centerOnInit;_this.applyTransformation();if(centerOnInit){_this.setCenter();_this.observer=new ResizeObserver((function(){var _a;_this.setCenter();(_a=_this.observer)===null||_a===void 0?void 0:_a.disconnect()}));_this.observer.observe(contentComponent)}};this.onWheelZoom=function(event){var disabled=_this.setup.disabled;if(disabled)return;var isAllowed=isWheelAllowed(_this,event);if(!isAllowed)return;var keysPressed=_this.isPressingKeys(_this.setup.wheel.activationKeys);if(!keysPressed)return;handleWheelStart(_this,event);handleWheelZoom(_this,event);handleWheelStop(_this,event)};this.onPanningStart=function(event){var disabled=_this.setup.disabled;var onPanningStart=_this.props.onPanningStart;if(disabled)return;var isAllowed=isPanningStartAllowed(_this,event);if(!isAllowed)return;var keysPressed=_this.isPressingKeys(_this.setup.panning.activationKeys);if(!keysPressed)return;event.preventDefault();event.stopPropagation();handleCancelAnimation(_this);handlePanningStart(_this,event);handleCallback(getContext(_this),event,onPanningStart)};this.onPanning=function(event){var disabled=_this.setup.disabled;var onPanning=_this.props.onPanning;if(disabled)return;var isAllowed=isPanningAllowed(_this);if(!isAllowed)return;var keysPressed=_this.isPressingKeys(_this.setup.panning.activationKeys);if(!keysPressed)return;event.preventDefault();event.stopPropagation();handlePanning(_this,event.clientX,event.clientY);handleCallback(getContext(_this),event,onPanning)};this.onPanningStop=function(event){var onPanningStop=_this.props.onPanningStop;if(_this.isPanning){handlePanningEnd(_this);handleCallback(getContext(_this),event,onPanningStop)}};this.onPinchStart=function(event){var disabled=_this.setup.disabled;var _a=_this.props,onPinchingStart=_a.onPinchingStart,onZoomStart=_a.onZoomStart;if(disabled)return;var isAllowed=isPinchStartAllowed(_this,event);if(!isAllowed)return;handlePinchStart(_this,event);handleCancelAnimation(_this);handleCallback(getContext(_this),event,onPinchingStart);handleCallback(getContext(_this),event,onZoomStart)};this.onPinch=function(event){var disabled=_this.setup.disabled;var _a=_this.props,onPinching=_a.onPinching,onZoom=_a.onZoom;if(disabled)return;var isAllowed=isPinchAllowed(_this);if(!isAllowed)return;event.preventDefault();event.stopPropagation();handlePinchZoom(_this,event);handleCallback(getContext(_this),event,onPinching);handleCallback(getContext(_this),event,onZoom)};this.onPinchStop=function(event){var _a=_this.props,onPinchingStop=_a.onPinchingStop,onZoomStop=_a.onZoomStop;if(_this.pinchStartScale){handlePinchStop(_this);handleCallback(getContext(_this),event,onPinchingStop);handleCallback(getContext(_this),event,onZoomStop)}};this.onTouchPanningStart=function(event){var disabled=_this.setup.disabled;var onPanningStart=_this.props.onPanningStart;if(disabled)return;var isAllowed=isPanningStartAllowed(_this,event);if(!isAllowed)return;var isDoubleTap=_this.lastTouch&&+new Date-_this.lastTouch<200;if(isDoubleTap&&event.touches.length===1){_this.onDoubleClick(event)}else{_this.lastTouch=+new Date;handleCancelAnimation(_this);var touches=event.touches;var isPanningAction=touches.length===1;var isPinchAction=touches.length===2;if(isPanningAction){handleCancelAnimation(_this);handlePanningStart(_this,event);handleCallback(getContext(_this),event,onPanningStart)}if(isPinchAction){_this.onPinchStart(event)}}};this.onTouchPanning=function(event){var disabled=_this.setup.disabled;var onPanning=_this.props.onPanning;if(_this.isPanning&&event.touches.length===1){if(disabled)return;var isAllowed=isPanningAllowed(_this);if(!isAllowed)return;event.preventDefault();event.stopPropagation();var touch=event.touches[0];handlePanning(_this,touch.clientX,touch.clientY);handleCallback(getContext(_this),event,onPanning)}else if(event.touches.length>1){_this.onPinch(event)}};this.onTouchPanningStop=function(event){_this.onPanningStop(event);_this.onPinchStop(event)};this.onDoubleClick=function(event){var disabled=_this.setup.disabled;if(disabled)return;var isAllowed=isDoubleClickAllowed(_this,event);if(!isAllowed)return;handleDoubleClick(_this,event)};this.clearPanning=function(event){if(_this.isPanning){_this.onPanningStop(event)}};this.setKeyPressed=function(e){_this.pressedKeys[e.key]=true};this.setKeyUnPressed=function(e){_this.pressedKeys[e.key]=false};this.isPressingKeys=function(keys){if(!keys.length){return true}return Boolean(keys.find((function(key){return _this.pressedKeys[key]})))};this.setTransformState=function(scale,positionX,positionY){var onTransformed=_this.props.onTransformed;if(!Number.isNaN(scale)&&!Number.isNaN(positionX)&&!Number.isNaN(positionY)){if(scale!==_this.transformState.scale){_this.transformState.previousScale=_this.transformState.scale;_this.transformState.scale=scale}_this.transformState.positionX=positionX;_this.transformState.positionY=positionY;var ctx_1=getContext(_this);_this.onChangeCallbacks.forEach((function(callback){return callback(ctx_1)}));handleCallback(ctx_1,{scale:scale,positionX:positionX,positionY:positionY},onTransformed);_this.applyTransformation()}else{console.error("Detected NaN set state values")}};this.setCenter=function(){if(_this.wrapperComponent&&_this.contentComponent){var targetState=getCenterPosition(_this.transformState.scale,_this.wrapperComponent,_this.contentComponent);_this.setTransformState(targetState.scale,targetState.positionX,targetState.positionY)}};this.handleTransformStyles=function(x,y,scale){if(_this.props.customTransform){return _this.props.customTransform(x,y,scale)}return getTransformStyles(x,y,scale)};this.applyTransformation=function(){if(!_this.mounted||!_this.contentComponent)return;var _a=_this.transformState,scale=_a.scale,positionX=_a.positionX,positionY=_a.positionY;var transform=_this.handleTransformStyles(positionX,positionY,scale);_this.contentComponent.style.transform=transform};this.getContext=function(){return getContext(_this)};this.onChange=function(callback){if(!_this.onChangeCallbacks.has(callback)){_this.onChangeCallbacks.add(callback)}return function(){_this.onChangeCallbacks.delete(callback)}};this.init=function(wrapperComponent,contentComponent){_this.cleanupWindowEvents();_this.wrapperComponent=wrapperComponent;_this.contentComponent=contentComponent;handleCalculateBounds(_this,_this.transformState.scale);_this.handleInitializeWrapperEvents(wrapperComponent);_this.handleInitialize(contentComponent);_this.initializeWindowEvents();_this.isInitialized=true;handleCallback(getContext(_this),void 0,_this.props.onInit)};this.props=props;this.setup=createSetup(this.props);this.transformState=createState(this.props)}return ZoomPanPinch2}();var Context=React__default.createContext(null);var getContent=function(children,ctx){if(typeof children==="function"){return children(ctx)}return children};var TransformWrapper=React__default.forwardRef((function(props,ref){var _a=useState(0),forceUpdate=_a[1];var children=props.children;var instance=useRef(new ZoomPanPinch(props)).current;var content=getContent(props.children,getContext(instance));var handleOnChange=useCallback((function(){if(typeof children==="function"){forceUpdate((function(prev){return prev+1}))}}),[children]);useImperativeHandle(ref,(function(){return getContext(instance)}),[instance]);useEffect((function(){instance.update(props)}),[instance,props]);useEffect((function(){return instance.onChange(handleOnChange)}),[instance,props,handleOnChange]);return React__default.createElement(Context.Provider,{value:instance},content)}));function styleInject(css,ref){if(ref===void 0)ref={};var insertAt=ref.insertAt;if(typeof document==="undefined"){return}var head=document.head||document.getElementsByTagName("head")[0];var style=document.createElement("style");style.type="text/css";if(insertAt==="top"){if(head.firstChild){head.insertBefore(style,head.firstChild)}else{head.appendChild(style)}}else{head.appendChild(style)}if(style.styleSheet){style.styleSheet.cssText=css}else{style.appendChild(document.createTextNode(css))}}var css_248z=".transform-component-module_wrapper__7HFJe {\n position: relative;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: hidden;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n margin: 0;\n padding: 0;\n}\n.transform-component-module_content__uCDPE {\n display: flex;\n flex-wrap: wrap;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n margin: 0;\n padding: 0;\n transform-origin: 0% 0%;\n}\n.transform-component-module_content__uCDPE img {\n pointer-events: none;\n}\n";var styles={wrapper:"transform-component-module_wrapper__7HFJe",content:"transform-component-module_content__uCDPE"};styleInject(css_248z);var TransformComponent=function(_a){var children=_a.children,_b=_a.wrapperClass,wrapperClass=_b===void 0?"":_b,_c=_a.contentClass,contentClass=_c===void 0?"":_c,wrapperStyle=_a.wrapperStyle,contentStyle=_a.contentStyle,_d=_a.wrapperProps,wrapperProps=_d===void 0?{}:_d,_e=_a.contentProps,contentProps=_e===void 0?{}:_e;var init=useContext(Context).init;var wrapperRef=useRef(null);var contentRef=useRef(null);useEffect((function(){var wrapper=wrapperRef.current;var content=contentRef.current;if(wrapper!==null&&content!==null&&init){init(wrapper,content)}}),[]);return React__default.createElement("div",__assign({},wrapperProps,{ref:wrapperRef,className:"react-transform-wrapper ".concat(styles.wrapper," ").concat(wrapperClass),style:wrapperStyle}),React__default.createElement("div",__assign({},contentProps,{ref:contentRef,className:"react-transform-component ".concat(styles.content," ").concat(contentClass),style:contentStyle}),children))};React__default.forwardRef((function(props,ref){var localRef=useRef(null);var instance=useContext(Context);useEffect((function(){return instance.onChange((function(ctx){if(localRef.current){var positionX=0;var positionY=0;localRef.current.style.transform=instance.handleTransformStyles(positionX,positionY,1/ctx.state.scale)}}))}),[instance]);return React__default.createElement("div",__assign({},props,{ref:mergeRefs([localRef,ref])}))}));function Slide({alt:alt,onClick:onClick=noop$3,onZoom:onZoom=noop$3,url:url,zooming:zooming=false}){const handlePinchingStop=({state:state})=>{const isZooming=state.scale>1;onZoom(isZooming)};return jsx(TransformWrapper,{doubleClick:{mode:"reset"},initialScale:1,onPinchingStop:handlePinchingStop,panning:{disabled:!zooming},children:jsx("button",{className:"Slide",onClick:onClick,onDoubleClick:()=>onZoom(false),tabIndex:-1,children:jsx(TransformComponent,{wrapperClass:"TransformComponent",children:jsx(Image,{alt:alt,url:url,zIndex:3})})})})}function Slides({urls:urls=[],current:current=0,onChange:onChange=noop$3,setIndex:setIndex}){const[zooming,setZooming]=useState(false);const[touchStart,setTouchStart]=useState(null);const[touchEnd,setTouchEnd]=useState(null);const minSwipeDistance=40;const onTouchStart=e=>{setTouchEnd(null);setTouchStart(e.targetTouches[0].clientX)};const onTouchMove=e=>setTouchEnd(e.targetTouches[0].clientX);const onTouchEnd=()=>{if(!touchStart||!touchEnd)return;const distance=touchStart-touchEnd;const isLeftSwipe=distance>minSwipeDistance;const isRightSwipe=distance<-minSwipeDistance;if(isLeftSwipe){setIndex(current<urls.length-1?current+1:urls.length-1)}else if(isRightSwipe){setIndex(current>0?current-1:0)}};const arrowLeft=()=>setIndex(current>0?current-1:0);const arrowRight=()=>setIndex(current<urls.length-1?current+1:urls.length-1);const handleZoom=isZooming=>setZooming(isZooming);return jsxs("div",{className:"Slides",onTouchEnd:onTouchEnd,onTouchMove:onTouchMove,onTouchStart:onTouchStart,children:[urls.length>1&&jsx(CircleIconButton,{className:"carousel-arrow-left",dark:true,icon:"chevron-left",onClick:arrowLeft,variant:"link"}),jsx(Slide,{onClick:()=>onChange(current),onZoom:handleZoom,url:urls[current],zooming:zooming}),urls.length>1&&jsx(CircleIconButton,{className:"carousel-arrow-right",dark:true,icon:"chevron-right",onClick:arrowRight,variant:"link"})]})}const useWindowSize=()=>{const[size,setSize]=useState({width:window.innerWidth,height:window.innerHeight});useEffect((()=>{const handleResize=()=>{setSize({width:window.innerWidth,height:window.innerHeight})};window.addEventListener("resize",handleResize);handleResize();return()=>window.removeEventListener("resize",handleResize)}),[]);return size};function Thumbnail({active:active=false,alt:alt,width:width,url:url,onClick:onClick,buttonRef:buttonRef}){const activeClasses=classnames("Thumbnail",{active:active});return jsx("button",{className:classnames(activeClasses),onClick:onClick,ref:buttonRef,style:{width:width},type:"button",children:jsx(Image,{alt:alt,size:"sm",url:url})})}function Thumbnails({current:current=0,onChange:onChange=noop$3,urls:urls=[]}){const viewportSize=useWindowSize();const thumbnailWidth=viewportSize.width/8;const shouldBeCentered=thumbnailWidth*urls.length<viewportSize.width*.9;const css=classnames("Thumbnails",{centered:shouldBeCentered});const otherProps={};const thumbnailsRef=React__default.createRef();useLayoutEffect((()=>{var _a,_b,_c;if(shouldBeCentered)return;const currentThumbnail=otherProps.buttonRef.current;const thumbWidth=currentThumbnail.clientWidth,scrollLeft=thumbWidth*current,firstThumb=thumbnailsRef.current.querySelector(".Thumbnail:first-child"),lastThumb=thumbnailsRef.current.querySelector(".Thumbnail:last-child");firstThumb.style.marginLeft=`${((_a=thumbnailsRef.current)==null?void 0:_a.clientWidth)/2-thumbWidth/2}px`;lastThumb.style.marginRight=`${((_b=thumbnailsRef.current)==null?void 0:_b.clientWidth)/2-thumbWidth/2}px`;(_c=thumbnailsRef.current)==null?void 0:_c.scrollTo(scrollLeft,0)}));return jsx("div",{className:css,ref:thumbnailsRef,children:urls.map(((url,i)=>{const active=i===current;if(active)otherProps.buttonRef=React__default.createRef();return jsx(Thumbnail,{active:active,alt:i.toString(),onClick:()=>onChange(i),url:url,...otherProps},i)}))})}function Carousel({currentIndex:currentIndex,photos:photos,onClick:onClick,onChange:onChange=()=>void 0,setIndex:setIndex}){useEffect((()=>{document.body.style.overflow="hidden";return()=>{document.body.style.overflow="initial"}}),[]);const handleChange=index=>{onChange(index)};return jsxs("div",{className:"Lightbox",children:[jsx(Slides,{current:currentIndex,onChange:handleChange,onClick:onClick,setIndex:setIndex,urls:photos.map((photo=>photo.url))}),photos.length>1?jsx(Thumbnails,{current:currentIndex,onChange:handleChange,urls:photos.map((photo=>photo.thumbnail))}):null]})}const Lightbox=props=>{const{aria:aria={},children:children,className:className,currentPhotoIndex:currentPhotoIndex,data:data={},description:description,htmlOptions:htmlOptions={},id:id="",initialPhoto:initialPhoto=0,photos:photos,onChange:onChange=()=>void 0,onClose:onClose,onClickRight:onClickRight,icon:icon="times",navRight:navRight,title:title}=props;const[activePhoto,setActivePhoto]=useState(initialPhoto);useEffect((()=>{onChange(activePhoto)}),[activePhoto]);useEffect((()=>{currentPhotoIndex!==void 0&¤tPhotoIndex!==null&&setActivePhoto(currentPhotoIndex)}),[currentPhotoIndex]);const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_lightbox_kit"),globalProps(props),className);const handleOnSlide=photoIndex=>{setActivePhoto(photoIndex)};const photosMap=useMemo((()=>photos.map((photo=>({url:photo,thumbnail:photo})))),[photos]);const api={onClose:onClose,onArrowLeft:()=>{setActivePhoto(activePhoto>0?activePhoto-1:0)},onArrowRight:()=>{const nextPhoto=activePhoto<photos.length-1?activePhoto+1:photos.length-1;setActivePhoto(nextPhoto)}};useKbdControls(api);const lightboxRef=useRef();return jsx(Fragment$1,{children:jsx(LightboxContext.Provider,{value:api,children:jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,ref:lightboxRef,children:jsxs("div",{className:"carousel",children:[jsx(Lightbox.Header,{icon:icon,navRight:navRight,onClickRight:onClickRight,onClose:onClose,text:description,title:title}),children,jsx(Carousel,{currentIndex:activePhoto,onChange:handleOnSlide,photos:photosMap,setIndex:setActivePhoto})]})})})})};Lightbox.Header=LightboxHeader;const MapCustomButton=({onClick:onClick,icon:icon})=>jsx(Button,{className:"pb_map-custom-button",onClick:onClick,children:jsx(Icon,{icon:icon})});const MapControls=({zoomBtns:zoomBtns,zoomInClick:zoomInClick,zoomOutClick:zoomOutClick,flyTo:flyTo,flyToClick:flyToClick,children:children})=>jsxs(Flex,{className:"custom-nav-control",orientation:"column",children:[zoomBtns?jsxs(Fragment,{children:[jsxs("div",{className:"custom-nav-control-zoom",children:[jsx(Button,{className:"map-zoom-in-button",onClick:zoomInClick,children:jsx(Icon,{icon:"plus"})}),jsx(Button,{className:"map-zoom-out-button",onClick:zoomOutClick,children:jsx(Icon,{icon:"minus"})})]}),flyTo?jsx(Button,{className:"map-flyto-button",onClick:flyToClick,children:jsx(Icon,{icon:"eye"})}):null]}):null,children]});const Map$1=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,zoomBtns:zoomBtns=false,flyTo:flyTo=false,zoomInClick:zoomInClick,zoomOutClick:zoomOutClick,flyToClick:flyToClick}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_map"),globalProps(props),className);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[zoomBtns?jsx(Map$1.Controls,{flyTo:flyTo,flyToClick:flyToClick,zoomBtns:zoomBtns,zoomInClick:zoomInClick,zoomOutClick:zoomOutClick}):null,children]})};Map$1.Controls=MapControls;const Timestamp=props=>{const{align:align="left",aria:aria={},className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},text:text2,timezone:timezone,timestamp:timestamp,showDate:showDate=true,showUser:showUser=false,hideUpdated:hideUpdated=false,showTimezone:showTimezone=false,unstyled:unstyled=false,variant:variant="default"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_timestamp_kit",align,{dark:dark,variant:variant}),globalProps(props),className);const currentYear=(new Date).getFullYear().toString();const dateDisplay=`${DateTime$1.toMonth(timestamp,timezone)} ${DateTime$1.toDay(timestamp,timezone)}`;const shouldShowUser=showUser==true&&text2.length>0;const shouldShowTimezone=showTimezone==true&&timezone.length>0;const updatedText=hideUpdated?"":"Last updated";const userDisplay=shouldShowUser?` by ${text2}`:"";let timeDisplay=`${DateTime$1.toHour(timestamp,timezone)}:${DateTime$1.toMinute(timestamp,timezone)}${DateTime$1.toMeridiem(timestamp,timezone)}`;const fullTimeDisplay=()=>{if(shouldShowTimezone){timeDisplay=`${timeDisplay} ${DateTime$1.toTimeZone(timestamp,timezone)}`}return timeDisplay};const fullDateDisplay=()=>{let fullDisplay=`${DateTime$1.toMonth(timestamp,timezone)} ${DateTime$1.toDay(timestamp,timezone)}`;if(DateTime$1.toYear(timestamp,timezone).toString()!==currentYear){fullDisplay=`${fullDisplay}, ${DateTime$1.toYear(timestamp,timezone)}`}return`${fullDisplay} ${" · "} ${fullTimeDisplay()}`};const formatUpdatedString=()=>`Last updated ${userDisplay} on ${dateDisplay} at ${timeDisplay}`;const formatElapsedString=()=>`${updatedText} ${userDisplay} ${DateTime$1.fromNow(timestamp)}`;const timestampText=()=>{switch(variant){case"updated":return formatUpdatedString();case"elapsed":return formatElapsedString();default:return showDate?timestamp?fullDateDisplay():text2:fullTimeDisplay()}};return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,children:jsx("div",{className:"pb_timestamp_kit",children:unstyled?jsx("div",{children:timestampText()}):jsx(Caption,{dark:dark,size:"xs",text:timestampText()})})})};const MessageMention=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,variant:variant="user"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_message_mention",variant),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children})};const Message=props=>{const{aria:aria={},avatarName:avatarName,avatarStatus:avatarStatus=null,avatarUrl:avatarUrl,children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,label:label,message:message,timestamp:timestamp,timestampObject:timestampObject,timezone:timezone,alignTimestamp:alignTimestamp="right"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const shouldDisplayAvatar=avatarUrl||avatarName;const baseClassName=shouldDisplayAvatar?"pb_message_kit_avatar":"pb_message_kit";const classes=classnames(buildCss(baseClassName),globalProps(props),className);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[shouldDisplayAvatar&&jsx(Avatar,{imageUrl:avatarUrl,name:avatarName,size:"xs",status:avatarStatus}),jsxs("div",{className:"content_wrapper",children:[jsxs(Flex,{justify:alignTimestamp==="left"?"none":"between",orientation:"row",children:[label&&jsx(Title,{className:"message_title",size:4,text:label}),jsx(Timestamp,{className:`pull-${alignTimestamp} ${timestampObject?"message_humanized_time":null}`,text:timestamp,timestamp:"",timezone:timezone}),timestampObject&&jsx(Timestamp,{className:`pull-${alignTimestamp} message_timestamp`,text:"",timestamp:timestampObject,timezone:timezone})]}),message&&jsx(Body$1,{className:"pb_message_body",text:message}),children]})]})};Message.Mention=MessageMention;const MultipleUsers=props=>{const{aria:aria={},className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},id:id,maxDisplayedUsers:maxDisplayedUsers=4,reverse:reverse=false,size:size="xs",users:users}=props;const displayCount=users.length>maxDisplayedUsers?maxDisplayedUsers-1:users.length;const usersToDisplay=users.slice(0,displayCount);const reverseClass=reverse===true?"reverse":"";const avatarSizeClass=size==="xxs"?"xxs":"xs";const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_multiple_users_kit",reverseClass),globalProps(props),className);const itemClasses=classnames("pb_multiple_users_item",buildCss("multiple_users_badge",avatarSizeClass));return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[usersToDisplay.map(((avatarData,index)=>createElement(Avatar,{...avatarData,className:"pb_multiple_users_item",dark:dark,imageAlt:avatarData.name,key:index,size:size}))),users.length>maxDisplayedUsers&&jsx("div",{className:itemClasses,children:`+${users.length-3}`})]})};const MultipleUsersStacked=props=>{const{aria:aria={},className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},id:id,users:users}=props;const moreThanTwo=users.length>2;const onlyOne=users.length==1;const displayCount=()=>moreThanTwo?1:users.length;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_multiple_users_stacked_kit",{single:onlyOne}),globalProps(props),className);const firstUser=()=>users.slice(0,1).map(((userObject,index)=>createElement(Avatar,{...userObject,className:"pb_multiple_users_stacked_item",dark:dark,key:index,size:"xs"})));const secondUser=()=>{if(moreThanTwo===false){return users.slice(1,2).map(((userObject,index)=>createElement(Avatar,{...userObject,className:"pb_multiple_users_stacked_item second_item",dark:dark,key:index,size:"xs"})))}};const plusUsers=()=>{if(moreThanTwo===true){return jsx(Badge,{className:"pb_multiple_users_stacked_item second_item",dark:dark,rounded:true,text:`+${users.length-displayCount()}`,variant:"primary"})}};return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[firstUser(),secondUser(),plusUsers()]})};const previousOverlayDirectionMap$1={bottom:"to top",top:"to bottom",left:"to right",right:"to left",x:"to right",y:"to top"};const subsequentOverlayDirectionMap$1={...previousOverlayDirectionMap$1,x:"to left",y:"to bottom"};const OverlayPercentage=props=>{const{children:children,color:color,position:position,size:size}=props;const getPreviousOverlayDirection=()=>previousOverlayDirectionMap$1[position];const getSubsequentOverlayDirection=()=>subsequentOverlayDirectionMap$1[position];const hasSubsequentOverlay=position==="x"||position==="y";const previousOverlay=`linear-gradient(${getPreviousOverlayDirection()}, ${colors[color]} 0%, transparent ${size})`;const subsequentOverlay=`linear-gradient(${getSubsequentOverlayDirection()}, ${colors[color]} 0%, transparent ${size})`;return jsxs(Fragment,{children:[jsx("div",{className:"overlay_linear_gradient",style:{background:previousOverlay}}),children,hasSubsequentOverlay&&jsx("div",{className:"overlay_linear_gradient",style:{background:subsequentOverlay}})]})};const previousOverlayDirectionMap={x:"left",y:"top"};const subsequentOverlayDirectionMap={x:"right",y:"bottom"};const OverlayToken=props=>{const{children:children,color:color,position:position,size:size}=props;const hasSubsequentOverlay=position==="x"||position==="y";const getPreviousOverlayDirection=()=>hasSubsequentOverlay?previousOverlayDirectionMap[position]:position;const getSubsequentOverlayDirection=()=>hasSubsequentOverlay?subsequentOverlayDirectionMap[position]:position;const previousOverlayClassName=`overlay_${color}_${getPreviousOverlayDirection()}_${size}`;const subsequentOverlayClassName=`overlay_${color}_${getSubsequentOverlayDirection()}_${size}`;return jsxs(Fragment,{children:[jsx("div",{className:previousOverlayClassName}),children,hasSubsequentOverlay&&jsx("div",{className:subsequentOverlayClassName})]})};const Overlay=props=>{const{aria:aria={},className:className,children:children,color:color="card_light",data:data={},htmlOptions:htmlOptions={},id:id,layout:layout={bottom:"full"}}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const classes=classnames(buildCss("pb_overlay"),globalProps(props),className);const htmlProps=buildHtmlProps(htmlOptions);const getPosition=()=>Object.keys(layout)[0];const getSize2=()=>Object.values(layout)[0];const isSizePercentage=getSize2().includes("%");return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:isSizePercentage?OverlayPercentage({children:children,color:color,position:getPosition(),size:getSize2()}):OverlayToken({children:children,color:color,position:getPosition(),size:getSize2()})})};const Person=props=>{const{aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},firstName:firstName,id:id,lastName:lastName}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_person_kit"),globalProps(props),className);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[jsx(Body$1,{className:"pb_person_first",tag:"span",children:firstName}),lastName&&jsx(Title,{className:"pb_person_first",size:4,text:` ${lastName}`})]})};const PersonContact=props=>{const{aria:aria={},className:className,contacts:contacts=[],data:data={},firstName:firstName,htmlOptions:htmlOptions={},id:id,lastName:lastName}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_person_contact_kit"),globalProps(props),className);const wrongContacts=()=>contacts.filter((contactObject=>contactObject.contactType==="wrong-phone"));const validContacts=()=>contacts.filter((contactObject=>contactObject.contactType!=="wrong-phone"));return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[jsx(Person,{firstName:firstName,lastName:lastName}),validContacts().map(((contactObject,index)=>jsx(Contact,{contactDetail:contactObject.contactDetail,contactType:contactObject.contactType,contactValue:contactObject.contactValue},`valid-contact-${index}`))),wrongContacts().map(((contactObject,index)=>jsxs("div",{children:[jsx(Caption,{className:"wrong_numbers",text:"wrong number"},`wrong-contact-caption-${index}`),jsx(Contact,{contactType:contactObject.contactType,contactValue:contactObject.contactValue},`wrong-contact-${index}`)]},`wrong-contact-caption-wrapper-${index}`)))]})};const ProgressPill=({active:active,dark:dark,steps:step})=>jsx("div",{className:`pb_progress_pill${step<=active?"_active":"_inactive"}${dark?" dark":""}`},step);const showSteps=(steps,active,dark)=>{const items=[];for(let step=1;step<=steps;step++){items.push(ProgressPill({steps:step,active:active,dark:dark}))}return items};const ProgressPills=props=>{const{active:active=0,aria:aria={hidden:"true"},className:className,data:data={},htmlOptions:htmlOptions={},id:id,steps:steps=3,title:title,value:value,dark:dark=false}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_progress_pills_kit"),globalProps(props),className);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[title&&jsxs("div",{className:"progress_pills_status",children:[jsx(Title,{dark:dark,size:4,tag:"h4",text:title}),jsx(Body$1,{color:"light",dark:dark,text:value})]}),jsx("div",{className:"progress_pills",children:showSteps(steps,active,dark)})]})};const ProgressSimple=props=>{const{align:align,className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},max:max2,muted:muted=false,percent:percent="",value:value,variant:variant="default",width:width="100%"}=props;const styles2={width:width};const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const variantStyle=variant=="default"?"":variant;const valueStyles={width:percent?`${percent}%`:`${value*100/max2}%`};const wrapperClass=classnames(buildCss("pb_progress_simple_wrapper",align,{dark:dark}),globalProps(props),className);const kitClass=classnames(buildCss("pb_progress_simple_kit",{muted:muted},variantStyle,align),className);return jsx("div",{...dataProps,...htmlProps,className:wrapperClass,children:jsx("div",{className:kitClass,"data-value":value,style:styles2,children:jsx("div",{className:"progress_simple_value",style:valueStyles})})})};const ProgressStep=props=>{const{aria:aria={},className:className,children:children,color:color,data:data={},orientation:orientation="horizontal",htmlOptions:htmlOptions={},icon:icon=false,showIcon:showIcon=false,variant:variant}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const iconStyle=icon===true||showIcon===true?"icon":"";const progressStepCss=buildCss("pb_progress_step_kit",orientation,iconStyle,variant,color);return jsx("ul",{...ariaProps,...dataProps,...htmlProps,className:classnames(progressStepCss,globalProps(props),className),children:children})};const ProgressStepItem=props=>{const{className:className,data:data={},status:status="inactive",children:children,htmlOptions:htmlOptions={},icon:icon="check"}=props;const progressStepItem=buildCss("pb_progress_step_item",status);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsx("li",{...dataProps,...htmlProps,className:classnames(progressStepItem,className),children:jsxs("div",{className:"box",children:[jsx("div",{className:"circle",children:jsx(Icon,{icon:icon})}),jsx("div",{className:"content",children:children})]})})};const createOptions=options=>options.map(((option,index)=>jsx("option",{disabled:option.disabled,value:option.value,children:option.text||option.value},index)));const Select=({aria:aria={},blankSelection:blankSelection,children:children,className:className,compact:compact=false,data:data={},disabled:disabled=false,error:error,label:label,htmlOptions:htmlOptions={},inline:inline=false,multiple:multiple=false,name:name,onChange:onChange=()=>void 0,options:options=[],required:required=false,showArrow:showArrow=false,value:value,...props},ref)=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const optionsList=createOptions(options);const inlineClass=inline?"inline":null;const compactClass=compact?"compact":null;const classes=classnames(buildCss("pb_select"),globalProps({...props,marginBottom:props.marginBottom||props.margin||"sm"}),className,inlineClass,{show_arrow:showArrow},compactClass);const selectWrapperClass=classnames(buildCss("pb_select_kit_wrapper"),{error:error},className);const selectBody=(()=>{if(children)return children;return jsxs("select",{...htmlOptions,...domSafeProps(props),disabled:disabled,id:name,multiple:multiple,name:name,onChange:onChange,ref:ref,required:required,value:value,children:[blankSelection&&jsx("option",{value:"",children:blankSelection}),optionsList]})})();return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,children:[label&&jsx("label",{className:"pb_select_kit_label",htmlFor:name,children:jsx(Caption,{text:label})}),jsxs("label",{className:selectWrapperClass,htmlFor:name,children:[selectBody,multiple!==true?jsx(Icon,{className:"pb_select_kit_caret",fixedWidth:true,icon:"angle-down"}):null,error&&jsx(Body$1,{status:"negative",text:error})]})]})};const Select$1=forwardRef(Select);const SelectableCard=props=>{const{aria:aria={},checked:checked=false,className:className,customIcon:customIcon,dark:dark=false,data:data={},disabled:disabled=false,error:error=false,htmlOptions:htmlOptions={},icon:icon=false,inputId:inputId=null,multi:multi=true,name:name,onChange:onChange=noop$2,text:text2,value:value,variant:variant="default"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_selectable_card_kit",{checked:checked,disabled:disabled,enabled:!disabled}),{error:error},dark?"dark":"",className);const displayIcon2=()=>{if(icon===true){return jsx("div",{className:"pb_selectable_card_circle",children:jsx(Icon,{customIcon:customIcon,fixedWidth:true,icon:"check"})})}};const inputRef=useRef(null);const handleClick=()=>{inputRef.current.click()};const inputType=multi?"checkbox":"radio";const inputIdPresent=inputId!==null?inputId:name;const Input=multi?Checkbox:Radio;const filteredProps={...props};filteredProps==null?true:delete filteredProps.inputId;filteredProps==null?true:delete filteredProps.children;filteredProps==null?true:delete filteredProps.icon;filteredProps==null?true:delete filteredProps.error;filteredProps==null?true:delete filteredProps.dark;filteredProps==null?true:delete filteredProps.multi;filteredProps==null?true:delete filteredProps.customIcon;const labelProps=variant==="displayInput"?{...filteredProps,padding:"none"}:{...filteredProps};return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,children:[jsx("input",{checked:checked,disabled:disabled,id:inputIdPresent,name:name,onChange:onChange,ref:inputRef,type:inputType,value:value,...filteredProps}),jsxs("label",{className:globalProps(labelProps),htmlFor:inputIdPresent,children:[variant==="displayInput"?jsxs(Flex,{vertical:"center",children:[jsx(Flex,{orientation:"column",padding:"sm",paddingRight:"xs",vertical:"center",children:jsx(Input,{dark:dark,children:jsx("input",{checked:checked,disabled:disabled,onClick:handleClick,readOnly:true,type:inputType})})}),jsx("div",{className:"separator"}),jsx("div",{className:"psuedo_separator"}),jsx(Card,{borderNone:true,dark:dark,padding:"sm",status:error?"negative":null,children:text2||props.children})]}):text2||props.children,displayIcon2()]})]})};const SelectableIcon=({aria:aria={},className:className,checked:checked=false,customIcon:customIcon,data:data={},disabled:disabled=false,htmlOptions:htmlOptions={},icon:icon,inputId:inputId,inputs:inputs="enabled",multi:multi=true,name:name,text:text2,value:value,...props})=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_selectable_icon_kit",{checked:checked,disabled:disabled,enabled:!disabled}),globalProps(props),className);const inputType=multi===false?"radio":"checkbox";const inputIdPresent=inputId!==null?inputId:name;return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,children:[inputs==="disabled"&&jsxs(Fragment,{children:[jsx(Icon,{customIcon:customIcon,icon:icon,size:"2x"}),jsx(Title,{size:4,tag:"h4",text:text2})]}),inputs==="enabled"&&jsxs(Fragment,{children:[jsx("input",{...props,checked:checked,disabled:disabled,id:inputIdPresent,name:name,type:inputType,value:value}),jsxs("label",{htmlFor:inputIdPresent,children:[jsx(Icon,{customIcon:customIcon,icon:icon,size:"2x"}),jsx(Title,{size:4,tag:"h4",text:text2})]})]})]})};const SelectableCardIcon=props=>{const{aria:aria={},checkmark:checkmark=false,checked:checked=false,className:className,customIcon:customIcon,dark:dark=false,data:data={},disabled:disabled=false,htmlOptions:htmlOptions={},icon:icon,inputId:inputId,multi:multi=true,name:name,titleText:titleText,bodyText:bodyText,value:value,onChange:onChange}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_selectable_card_icon_kit",{checked:checked,disabled:disabled,enabled:!disabled}),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,children:jsx(SelectableCard,{checked:checked,customIcon:customIcon,dark:dark,disabled:disabled,icon:checkmark,inputId:inputId,multi:multi,name:name,onChange:onChange,value:value,children:jsxs(Fragment,{children:[jsx(SelectableIcon,{customIcon:customIcon,icon:icon,inputId:"",inputs:"disabled",name:"",text:titleText}),jsx(Body$1,{color:"light",dark:dark,text:bodyText})]})})})};const SelectableListItem=({aria:aria={},checked:checked=false,children:children,className:className,data:data={},dragId:dragId,dragHandle:dragHandle=true,defaultChecked:defaultChecked,htmlOptions:htmlOptions={},id:id,label:label,text:text2="",name:name="",value:value="",variant:variant="checkbox",onChange:onChange=()=>{},...props})=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_selectable_list_item_kit"),globalProps(props),className);const initialCheckedState=checked;const[checkedState,setCheckedState]=useState(initialCheckedState);const handleChecked=event=>{onChange(event);setCheckedState(event.target.checked)};return jsx(ListItem,{...props,className:classnames(checkedState?"checked_item":"",className),dragHandle:dragHandle,dragId:dragId,children:jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,children:[variant=="checkbox"&&jsxs(Fragment,{children:[jsx(Checkbox,{checked:checkedState,id:id,name:name,onChange:handleChecked,text:label||text2&&false,type:"checkbox",value:value,...props}),children]}),variant=="radio"&&jsxs(Fragment,{children:[jsx(Radio,{defaultChecked:defaultChecked,id:id,label:label,name:name,onChange:onChange,text:label,type:"radio",value:value,...domSafeProps(props)}),children]}),variant!=="checkbox"&&variant!=="radio"&&{children:children}]})})};const SelectableList=props=>{var _a,_b;const{aria:aria={},children:children,className:className,data:data={},enableDrag:enableDrag=false,htmlOptions:htmlOptions={},id:id}=props;const ariaProps=buildAriaProps(aria);const classes=classnames(buildCss("pb_selectable_list_kit"),globalProps(props),className);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const isRadio=props.variant==="radio";const defaultCheckedRadioValue=(_b=(_a=children.filter((item=>item.props.defaultChecked))[0])==null?void 0:_a.props)==null?void 0:_b.value;const[selectedRadioValue,setSelectedRadioValue]=useState(defaultCheckedRadioValue);const onChangeRadioValue=({target:target})=>{setSelectedRadioValue(target.value)};let selectableListItems=children;if(isRadio){selectableListItems=children.map((({props:props2})=>createElement(SelectableListItem,{...props2,className:classnames(selectedRadioValue===props2.value?"checked_item":"",props2.className),key:props2.value,onChange:evt=>{var _a2;onChangeRadioValue(evt);(_a2=props2==null?void 0:props2.onChange)==null?void 0:_a2.call(props2,evt)}})))}return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsx(List,{enableDrag:enableDrag,variant:props.variant,children:selectableListItems})})};SelectableList.Item=SelectableListItem;const Source=({aria:aria={},className:className,data:data={},hideIcon:hideIcon=false,htmlOptions:htmlOptions={},id:id,source:source,type:type="inbound",user:user={}})=>{const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const ariaProps=buildAriaProps(aria);const css=classnames(["pb_source_kit",className]);const avatar=()=>{if((type==="user"||type==="referral")&&user.name!==void 0){const avatarProps={...user};avatarProps.size="sm";delete avatarProps.userId;return avatarProps}};const typeText=()=>{if(type==="user"||type==="referral"&&user.name!==void 0){return user.name}else{return titleize(type)}};const typeIconNames={events:"calendar-alt",outbound:"sign-out",prospecting:"binoculars",referral:"handshake",retail:"shopping-bag",inbound:"sign-in"};const showIcon=()=>type!=="user"&&avatar()===void 0;return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:css,id:id,children:jsxs("div",{className:"pb__source_layout",children:[hideIcon===false&&jsxs(Fragment,{children:[showIcon()&&jsx(IconCircle,{icon:typeIconNames[type],size:"sm"}),!showIcon()&&jsx(Avatar,{...avatar()})]}),jsxs("div",{className:"pb__source_content",children:[jsx(Title,{size:4,tag:"h4",text:source}),jsxs("div",{className:"pb__source_value",children:[jsx(Body$1,{color:"light",text:typeText()}),user.userId&&jsx(Caption,{text:user.userId})]})]})]})})};const starYellow=jsx("svg",{className:"iamyellow",fill:"none",viewBox:"0 0 18 16",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{clipRule:"evenodd",d:"M9.86015 0.4371C9.73527 0.187329 9.4855 0 9.17328 0C8.89229 0 8.64252 0.187329 8.51763 0.4371L6.36335 4.83932L1.58647 5.55742C1.30547 5.58864 1.08692 5.80719 0.99326 6.05696C0.899595 6.33795 0.962038 6.61895 1.18059 6.8375L4.64617 10.2719L3.80319 15.1112C3.77197 15.3922 3.89685 15.7044 4.11541 15.8605C4.36518 16.0166 4.64617 16.0478 4.89594 15.9229L9.17328 13.6126L13.4506 15.9229C13.7004 16.0478 14.0126 16.0166 14.2624 15.8605C14.4809 15.7044 14.6058 15.3922 14.5434 15.1112L13.7316 10.2719L17.1972 6.8375C17.4157 6.61895 17.4782 6.33795 17.3845 6.05696C17.2909 5.80719 17.0723 5.58864 16.7913 5.55742L12.0144 4.83932L9.86015 0.4371Z",fill:"#F9BB00",fillRule:"evenodd"})});const starPrimary=jsx("svg",{fill:"none",viewBox:"0 0 18 16",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{clipRule:"evenodd",d:"M9.86015 0.4371C9.73527 0.187329 9.4855 0 9.17328 0C8.89229 0 8.64252 0.187329 8.51763 0.4371L6.36335 4.83932L1.58647 5.55742C1.30547 5.58864 1.08692 5.80719 0.99326 6.05696C0.899595 6.33795 0.962038 6.61895 1.18059 6.8375L4.64617 10.2719L3.80319 15.1112C3.77197 15.3922 3.89685 15.7044 4.11541 15.8605C4.36518 16.0166 4.64617 16.0478 4.89594 15.9229L9.17328 13.6126L13.4506 15.9229C13.7004 16.0478 14.0126 16.0166 14.2624 15.8605C14.4809 15.7044 14.6058 15.3922 14.5434 15.1112L13.7316 10.2719L17.1972 6.8375C17.4157 6.61895 17.4782 6.33795 17.3845 6.05696C17.2909 5.80719 17.0723 5.58864 16.7913 5.55742L12.0144 4.83932L9.86015 0.4371Z",fill:"#0056CF",fillRule:"evenodd"})});const starSubtle=jsx("svg",{fill:"none",viewBox:"0 0 18 16",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{clipRule:"evenodd",d:"M8.90904 0.4371C8.78416 0.187329 8.53438 0 8.22217 0C7.94118 0 7.69141 0.187329 7.56652 0.4371L5.41224 4.83932L0.635357 5.55742C0.354364 5.58864 0.135813 5.80719 0.042149 6.05696C-0.0515154 6.33795 0.0109275 6.61895 0.229478 6.8375L3.69506 10.2719L2.85208 15.1112C2.82086 15.3922 2.94574 15.7044 3.16429 15.8605C3.41407 16.0166 3.69506 16.0478 3.94483 15.9229L8.22217 13.6126L12.4995 15.9229C12.7493 16.0478 13.0615 16.0166 13.3113 15.8605C13.5298 15.7044 13.6547 15.3922 13.5923 15.1112L12.7805 10.2719L16.2461 6.8375C16.4646 6.61895 16.5271 6.33795 16.4334 6.05696C16.3397 5.80719 16.1212 5.58864 15.8402 5.55742L11.0633 4.83932L8.90904 0.4371Z",fillRule:"evenodd"})});const starOutline=jsx("svg",{fill:"none",height:"16",viewBox:"0 0 17 16",width:"17",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M5.91323 5.33377L6.17269 5.29477L6.28801 5.0591L8.44116 0.659187C8.49971 0.543364 8.59517 0.5 8.64884 0.5C8.74499 0.5 8.83506 0.555009 8.88775 0.659235L11.0409 5.0591L11.1562 5.29477L11.4157 5.33377L16.1925 6.05186L16.2021 6.0533L16.2117 6.05436C16.2359 6.05706 16.2671 6.06847 16.3024 6.09973C16.3374 6.13062 16.3686 6.17476 16.3886 6.22412C16.4186 6.32162 16.401 6.40181 16.3198 6.48332C16.3196 6.48353 16.3194 6.48374 16.3192 6.48395L12.8552 9.91671L12.6712 10.0991L12.7141 10.3546L13.5258 15.1939L13.528 15.2068L13.5308 15.2196C13.5488 15.3004 13.5074 15.402 13.4567 15.4462C13.3391 15.5132 13.2227 15.5096 13.1546 15.4781L8.88646 13.1726L8.64884 13.0443L8.41121 13.1726L4.14274 15.4782C4.07877 15.5083 3.99031 15.5147 3.87267 15.4466C3.82302 15.4033 3.76655 15.2914 3.77463 15.1781L4.61431 10.3577L4.65911 10.1005L4.47368 9.91671L1.0097 6.48394C1.00947 6.48372 1.00925 6.4835 1.00903 6.48327C0.927878 6.40178 0.91031 6.3216 0.94026 6.22412C0.960274 6.17476 0.99154 6.13062 1.02646 6.09973C1.0618 6.06847 1.09296 6.05706 1.11724 6.05436L1.12682 6.0533L1.13635 6.05186L5.91323 5.33377Z",stroke:"#C1CDD6"})});const getStarIconObject=(backgroundType,color,dark,size)=>{const colorClassName=color==="subtle"?dark?"suble_star_dark":"suble_star_light":`${color}_star`;const backgroundClassName=backgroundType==="outline"?dark?"outline_empty_star_dark":"outline_empty_star_light":dark?"empty_star_dark":"empty_star_light";return{yellow:{className:`pb_star_${size} ${colorClassName}`,icon:starYellow},primary:{className:`pb_star_${size} ${colorClassName}`,icon:starPrimary},subtle:{className:`pb_star_${size} ${colorClassName}`,icon:starSubtle},fill:{className:`pb_star_${size} ${backgroundClassName}`,icon:starYellow},outline:{className:`pb_star_${size} ${backgroundClassName}`,icon:starOutline}}};const StarRatingInteractive=props=>{const{backgroundType:backgroundType,colorOption:colorOption,dark:dark,denominator:denominator,onClick:onClick,size:size}=props;const[interactiveStarValue,setInteractiveStarValue]=useState(0);const starIcon=getStarIconObject(backgroundType,colorOption,dark,size);const handleOnClick=interactiveStarValue2=>{setInteractiveStarValue(interactiveStarValue2);onClick&&onClick(interactiveStarValue2)};return jsx(Flex,{className:"star_flex_area",children:[...Array(denominator)].map(((_,index)=>jsxs(React__default.Fragment,{children:[index+1<=interactiveStarValue&&jsx(Icon,{className:starIcon[colorOption].className,cursor:"pointer",customIcon:starIcon[colorOption].icon,htmlOptions:{onClick:()=>handleOnClick(index+1)},icon:""}),index+1>interactiveStarValue&&jsx(React__default.Fragment,{children:jsx(Icon,{className:starIcon[backgroundType].className,cursor:"pointer",customIcon:starIcon[backgroundType].icon,htmlOptions:{onClick:()=>handleOnClick(index+1)},icon:""})},index)]},index)))})};const StarRatingDisplay=props=>{const{backgroundType:backgroundType,colorOption:colorOption,dark:dark,denominator:denominator,layoutOption:layoutOption,rating:rating,size:size}=props;const denominatorStyle=layoutOption==="onestar"?1:denominator;const activeStars=Math.round(rating)>denominatorStyle?denominatorStyle:Math.round(rating);const emptyStars=denominatorStyle-Math.round(rating)<0?0:denominatorStyle-Math.round(rating);const starIcon=getStarIconObject(backgroundType,colorOption,dark,size);return jsxs(Flex,{className:"star_flex_area",children:[[...Array(activeStars)].map(((_,index)=>jsx(React__default.Fragment,{children:jsx(Icon,{className:starIcon[colorOption].className,customIcon:starIcon[colorOption].icon,icon:""})},index))),[...Array(emptyStars)].map(((_,index)=>jsx(React__default.Fragment,{children:jsx(Icon,{className:starIcon[backgroundType].className,customIcon:starIcon[backgroundType].icon,icon:""})},index)))]})};const StarRating=props=>{const{aria:aria={},className:className,data:data={},dark:dark=false,layoutOption:layoutOption="default",htmlOptions:htmlOptions={},id:id,rating:rating=0,denominator:denominator=5,colorOption:colorOption="yellow",backgroundType:backgroundType="fill",size:size="sm",variant:variant="display",onClick:onClick}=props;const classes=classnames(buildCss("pb_star_rating_kit"),globalProps(props),className);const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const oneDecimalRating=rating.toFixed(1);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[layoutOption==="number"&&jsxs(Fragment,{children:[(size==="xs"||size==="sm")&&jsx(Caption,{className:"pb_star_rating_number_sm",dark:dark,paddingRight:"xs",size:"xs",text:oneDecimalRating.toString()}),size==="md"&&jsx(Body$1,{className:"pb_star_rating_number_md",color:"light",dark:dark,paddingRight:"xs",text:oneDecimalRating.toString()}),size==="lg"&&jsx(Title,{bold:false,className:"pb_star_rating_number_lg",color:"light",dark:dark,paddingRight:"sm",size:2,text:oneDecimalRating.toString()})]}),variant==="display"&&jsx(StarRatingDisplay,{backgroundType:backgroundType,colorOption:colorOption,dark:dark,denominator:denominator,layoutOption:layoutOption,rating:rating,size:size}),variant==="interactive"&&jsx(StarRatingInteractive,{backgroundType:backgroundType,colorOption:colorOption,dark:dark,denominator:denominator,onClick:onClick,size:size}),layoutOption==="onestar"&&jsxs(Fragment,{children:[(size==="xs"||size==="sm")&&jsx(Caption,{className:"pb_star_rating_number_sm",dark:dark,size:"xs",text:`${rating.toString()} of ${denominator}`}),size==="md"&&jsx(Body$1,{className:"pb_star_rating_number_md",color:"light",dark:dark,text:`${rating.toString()} of ${denominator}`}),size==="lg"&&jsx(Title,{bold:false,className:"pb_star_rating_number_lg",color:"light",dark:dark,size:2,text:`${rating.toString()} of ${denominator}`})]})]})};const Textarea=({aria:aria={},characterCount:characterCount,className:className,children:children,data:data={},disabled:disabled,htmlOptions:htmlOptions={},inline:inline=false,resize:resize="none",error:error,label:label,maxCharacters:maxCharacters,name:name,onChange:onChange=()=>{},placeholder:placeholder,required:required,rows:rows=4,value:value,...props},ref)=>{ref=useRef(null);useEffect((()=>{if(ref.current&&resize==="auto"){PbTextarea.addMatch(ref.current)}}));const errorClass=error?"error":null;const inlineClass=inline?"inline":"";const resizeClass=`resize_${resize}`;const classes=classnames("pb_textarea_kit",errorClass,inlineClass,resizeClass,globalProps(props),className);const noCount=typeof characterCount!=="undefined";const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const characterCounter=()=>maxCharacters&&characterCount?`${checkIfZero(characterCount)} / ${maxCharacters}`:`${checkIfZero(characterCount)}`;const checkIfZero=characterCount2=>characterCount2==0?characterCount2.toString():characterCount2;return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,children:[jsx(Caption,{text:label}),children||jsx("textarea",{className:"pb_textarea_kit",disabled:disabled,name:name,onChange:onChange,placeholder:placeholder,ref:ref,required:required,rows:rows,value:value,...props}),error?jsx(Fragment,{children:characterCount?jsxs(Flex,{spacing:"between",vertical:"center",children:[jsx(FlexItem,{children:jsx(Body$1,{margin:"none",status:"negative",text:error})}),jsx(FlexItem,{children:jsx(Caption,{margin:"none",size:"xs",text:characterCounter()})})]}):jsx(Body$1,{status:"negative",text:error})}):noCount&&jsx(Caption,{margin:"none",size:"xs",text:characterCounter()})]})};const Textarea$1=forwardRef(Textarea);const timezoneString=dateValue=>`${DateTime$1.toTimeZone(dateValue)}`;const dateTimestamp=dateValue=>`${DateTime$1.toHour(dateValue)}:${DateTime$1.toMinute(dateValue)}${DateTime$1.toMeridiem(dateValue)}`;const dateTimeIso=dateValue=>DateTime$1.toIso(dateValue);const TimeRangeInline=props=>{const{aria:aria={},className:className,data:data={},alignment:alignment="left",htmlOptions:htmlOptions={},size:size="sm",dark:dark=false,icon:icon=false,timezone:timezone=false,startTime:startTime,endTime:endTime,id:id}=props;const dataProps=buildDataProps(data);const ariaProps=buildAriaProps(aria);const htmlProps=buildHtmlProps(htmlOptions);const separator=jsx(Body$1,{color:"light",children:jsx(Icon,{className:"pb_time_range_inline_arrow",dark:dark,fixedWidth:true,icon:"long-arrow-right"})});const iconContent=()=>icon&&jsx(Body$1,{color:"light",tag:"span",children:jsx(Icon,{className:"pb_time_range_inline_icon",dark:dark,fixedWidth:true,icon:"clock",size:size,tag:"span"})});return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classnames("pb_time_range_inline_kit_"+alignment,globalProps(props),className),id:id,children:jsxs("div",{className:"pb_time_range_inline_wrapper",children:[size=="xs"&&jsxs(Fragment,{children:[jsxs(Caption,{dark:dark,tag:"span",children:[iconContent(),jsx("time",{dateTime:dateTimeIso(startTime),children:` ${dateTimestamp(startTime)} `})]}),jsx(Caption,{className:"pb_time_range_inline_arrow",dark:dark,tag:"span",children:separator}),jsx(Caption,{dark:dark,tag:"span",children:jsx("time",{dateTime:dateTimeIso(endTime),children:` ${dateTimestamp(endTime)} `})}),timezone&&jsx(Caption,{className:"pb_time_range_inline_timezone",dark:dark,tag:"span",children:timezoneString(endTime)})]}),size=="sm"&&jsxs(Fragment,{children:[jsxs(Body$1,{dark:dark,tag:"span",children:[iconContent(),jsx("time",{dateTime:dateTimeIso(startTime),children:` ${dateTimestamp(startTime)} `})]}),jsx(Body$1,{className:"pb_time_range_inline_arrow",dark:dark,tag:"span",children:separator}),jsx(Body$1,{dark:dark,tag:"span",children:jsx("time",{dateTime:dateTimeIso(endTime),children:` ${dateTimestamp(endTime)} `})}),timezone&&jsx(Body$1,{className:"pb_time_range_inline_timezone",color:"light",dark:dark,tag:"span",children:timezoneString(endTime)})]})]})})};const TimelineItem=({className:className,children:children,date:date,htmlOptions:htmlOptions={},icon:icon="user",iconColor:iconColor="default",lineStyle:lineStyle="solid",...props})=>{const timelineItemCss=buildCss("pb_timeline_item_kit",lineStyle);const htmlProps=buildHtmlProps(htmlOptions);return jsxs("div",{...htmlProps,className:classnames(timelineItemCss,globalProps(props),className),children:[jsx("div",{className:"pb_timeline_item_left_block",children:date&&jsx(DateStacked,{align:"center",date:date,size:"sm"})}),jsxs("div",{className:"pb_timeline_item_step",children:[jsx(IconCircle,{icon:icon,size:"xs",variant:iconColor}),jsx("div",{className:"pb_timeline_item_connector"})]}),jsx("div",{className:"pb_timeline_item_right_block",children:children})]})};const Timeline=({aria:aria={},className:className,children:children,data:data={},htmlOptions:htmlOptions={},id:id,orientation:orientation="horizontal",showDate:showDate=false,...props})=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const dateStyle=showDate===true?"_with_date":"";const timelineCss=buildCss("pb_timeline_kit",`_${orientation}`,dateStyle);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classnames(timelineCss,globalProps(props),className),id:id,children:children})};Timeline.Item=TimelineItem;const TitleDetail=props=>{const{align:align="left",aria:aria={},className:className,data:data={},detail:detail,htmlOptions:htmlOptions={},id:id,title:title}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const pbCss=buildCss("pb_title_detail_kit",align);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classnames(pbCss,globalProps(props),className),id:id,children:[jsx(Title,{size:4,text:title}),jsx(Body$1,{color:"light",text:detail})]})};const Toggle=({aria:aria={},checked:checked=false,children:children,className:className,data:data={},disabled:disabled=false,id:id,htmlOptions:htmlOptions={},name:name,onChange:onChange=()=>{},size:size="sm",value:value,...props})=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const css=classnames(buildCss("pb_toggle_kit",size,{on:checked,off:!checked}));return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classnames(css,globalProps(props),className),id:id,children:jsxs("label",{className:"pb_toggle_wrapper",children:[children&&children,!children&&jsx("input",{...props,defaultChecked:checked,disabled:disabled,name:name,onChange:onChange,type:"checkbox",value:value}),jsx("div",{className:"pb_toggle_control"})]})})};const Veteran=()=>jsxs("svg",{viewBox:"0 0 200 250",xmlSpace:"preserve",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M198.4 71.5V71c-.2-1.2-1.4-2.1-1.4-2.1L103.2 2.7c-.7-.4-1-.6-1.6-.6-1.3 0-2.3 1-2.3 2.3v67.1h-.6v29.6h99.8l-.1-29.6z",fill:"#004876"}),jsx("path",{d:"M172.9 159.2c-31.4 23-33.2 24.3-33.2 24.3l-40.5 3.2v-29.4l73.7 1.9z",fill:"#FFF"}),jsx("path",{d:"M99.3 125.4V33.5L1.6 102.7l-.1.1c-1 .7-1.5 1.8-1.5 3v67.4c0 1.2.6 2.3 1.5 3l.1.1 93.5 66.3c1.7 1.2 4.1 0 4.1-2.1v-28.9l40.5-28-40.5.7v-25h73.7l25.4-16.9.2-16.8H99.3z",fill:"#BB2432"}),jsx("path",{d:"M99.3 101.1h99.3v24.3H99.3z",fill:"#FFF"})]});const MillionDollar=()=>jsxs("svg",{viewBox:"0 0 242.9 242.9",xmlSpace:"preserve",xmlns:"http://www.w3.org/2000/svg",children:[jsx("circle",{cx:121.5,cy:121.5,r:121.5}),jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"a",x1:42.483,x2:200.309,y1:35.645,y2:35.645,children:[jsx("stop",{offset:0,style:{stopColor:"#e6b711"}}),jsx("stop",{offset:.128,style:{stopColor:"#eac23c"}}),jsx("stop",{offset:.278,style:{stopColor:"#ec6"}}),jsx("stop",{offset:.413,style:{stopColor:"#f1d485"}}),jsx("stop",{offset:.527,style:{stopColor:"#f2d998"}}),jsx("stop",{offset:.607,style:{stopColor:"#f3db9f"}}),jsx("stop",{offset:1,style:{stopColor:"#e6b711"}})]}),jsx("path",{d:"M56.4 53.8c16.9-16.2 39.8-26.2 65-26.2 25.2 0 48.1 10 64.9 26.2h14c-19.1-22.2-47.4-36.3-78.9-36.3-31.5 0-59.8 14.1-78.9 36.3h13.9z",style:{fill:"url(#a)"}}),jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"b",x1:17.407,x2:44.897,y1:132.179,y2:132.179,children:[jsx("stop",{offset:0,style:{stopColor:"#e6b711"}}),jsx("stop",{offset:.128,style:{stopColor:"#eac23c"}}),jsx("stop",{offset:.278,style:{stopColor:"#ec6"}}),jsx("stop",{offset:.413,style:{stopColor:"#f1d485"}}),jsx("stop",{offset:.527,style:{stopColor:"#f2d998"}}),jsx("stop",{offset:.607,style:{stopColor:"#f3db9f"}}),jsx("stop",{offset:1,style:{stopColor:"#e6b711"}})]}),jsx("path",{d:"M44.9 175.7c-10.9-15.3-17.3-34-17.3-54.2 0-14.1 3.1-27.5 8.8-39.5H25.3c-5 12.2-7.8 25.5-7.8 39.5 0 22.7 7.3 43.8 19.8 60.9l7.6-6.7z",style:{fill:"url(#b)"}}),jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"c",x1:52.914,x2:189.715,y1:212.573,y2:212.573,children:[jsx("stop",{offset:0,style:{stopColor:"#e6b711"}}),jsx("stop",{offset:.128,style:{stopColor:"#eac23c"}}),jsx("stop",{offset:.278,style:{stopColor:"#ec6"}}),jsx("stop",{offset:.413,style:{stopColor:"#f1d485"}}),jsx("stop",{offset:.527,style:{stopColor:"#f2d998"}}),jsx("stop",{offset:.607,style:{stopColor:"#f3db9f"}}),jsx("stop",{offset:1,style:{stopColor:"#e6b711"}})]}),jsx("path",{d:"M173 199.8c-14.8 9.8-32.5 15.5-51.6 15.5s-37-5.8-51.8-15.6H52.9c18.3 16.1 42.3 25.8 68.5 25.8 26.1 0 50-9.7 68.3-25.7H173z",style:{fill:"url(#c)"}}),jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"d",x1:31.123,x2:207.766,y1:136.159,y2:136.159,children:[jsx("stop",{offset:0,style:{stopColor:"#e6b711"}}),jsx("stop",{offset:.128,style:{stopColor:"#eac23c"}}),jsx("stop",{offset:.278,style:{stopColor:"#ec6"}}),jsx("stop",{offset:.413,style:{stopColor:"#f1d485"}}),jsx("stop",{offset:.527,style:{stopColor:"#f2d998"}}),jsx("stop",{offset:.607,style:{stopColor:"#f3db9f"}}),jsx("stop",{offset:1,style:{stopColor:"#e6b711"}})]}),jsx("path",{d:"M139.2 193v-1.8c5-.4 10.2-.5 13.4-5 3.8-5.2 3.2-15.4 3.2-21.5V78.5l-47.3 120.4L61.2 81.2v61.1c0 13.6.5 35.1 12.5 44.2 4.3 3.2 9 3.9 14.2 4.7v1.8H31.1v-1.8c1.6-.4 3.2-.7 4.8-1.1 22.6-5.7 22.9-32.4 22.9-51.1v-37.8c0-6.1.5-13.3-3.2-18.5-4.5-6.1-13.4-7.2-20.4-7.5v-1.8H96l29.6 75.4 29.9-75.4h52.3v1.8c-4.8.4-10.2.9-13.4 5-3.8 4.8-3.2 15.9-3.2 21.9v62.5c0 6.3-.7 16.1 3.2 21.5 3.2 4.3 6.2 4.7 11.2 5v1.8h-66.4z",style:{fill:"url(#d)"}}),jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"e",x1:30.453,x2:213.794,y1:63.629,y2:63.629,children:[jsx("stop",{offset:0,style:{stopColor:"#e6b711"}}),jsx("stop",{offset:.128,style:{stopColor:"#eac23c"}}),jsx("stop",{offset:.278,style:{stopColor:"#ec6"}}),jsx("stop",{offset:.413,style:{stopColor:"#f1d485"}}),jsx("stop",{offset:.527,style:{stopColor:"#f2d998"}}),jsx("stop",{offset:.607,style:{stopColor:"#f3db9f"}}),jsx("stop",{offset:1,style:{stopColor:"#e6b711"}})]}),jsx("path",{d:"M30.5 60.6h183.3v6.1H30.5z",style:{fill:"url(#e)"}}),jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"f",x1:196.676,x2:225.538,y1:132.923,y2:132.923,children:[jsx("stop",{offset:0,style:{stopColor:"#e6b711"}}),jsx("stop",{offset:.128,style:{stopColor:"#eac23c"}}),jsx("stop",{offset:.278,style:{stopColor:"#ec6"}}),jsx("stop",{offset:.413,style:{stopColor:"#f1d485"}}),jsx("stop",{offset:.527,style:{stopColor:"#f2d998"}}),jsx("stop",{offset:.607,style:{stopColor:"#f3db9f"}}),jsx("stop",{offset:1,style:{stopColor:"#e6b711"}})]}),jsx("path",{d:"M196.7 177.5c11.5-15.6 18.7-35.2 18.7-56 0-14.1-3.1-27.5-8.8-39.5h11.1c5 12.2 7.8 25.5 7.8 39.5 0 23.4-7.8 45-20.9 62.4l-7.9-6.4z",style:{fill:"url(#f)"}})]});const UserBadge=props=>{const{aria:aria={},badge:badge="million-dollar",className:className,data:data={},htmlOptions:htmlOptions={},id:id,size:size="md"}=props;const image=badge==="million-dollar"?jsx(MillionDollar,{}):jsx(Veteran,{});const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_user_badge_kit",size),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsx("div",{className:"pb_user_badge_wrapper",children:image})})};function isOfType$2(type){return function(value){return typeof value===type}}var isFunction$1=isOfType$2("function");var isNull=function(value){return value===null};var isRegex=function(value){return Object.prototype.toString.call(value).slice(8,-1)==="RegExp"};var isObject=function(value){return!isUndefined(value)&&!isNull(value)&&(isFunction$1(value)||typeof value==="object")};var isUndefined=isOfType$2("undefined");var __values=function(o){var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};function equalArray(left,right){var length=left.length;if(length!==right.length){return false}for(var index=length;index--!==0;){if(!equal(left[index],right[index])){return false}}return true}function equalArrayBuffer(left,right){if(left.byteLength!==right.byteLength){return false}var view1=new DataView(left.buffer);var view2=new DataView(right.buffer);var index=left.byteLength;while(index--){if(view1.getUint8(index)!==view2.getUint8(index)){return false}}return true}function equalMap(left,right){var e_1,_a,e_2,_b;if(left.size!==right.size){return false}try{for(var _c=__values(left.entries()),_d=_c.next();!_d.done;_d=_c.next()){var index=_d.value;if(!right.has(index[0])){return false}}}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(_d&&!_d.done&&(_a=_c.return))_a.call(_c)}finally{if(e_1)throw e_1.error}}try{for(var _e=__values(left.entries()),_f=_e.next();!_f.done;_f=_e.next()){var index=_f.value;if(!equal(index[1],right.get(index[0]))){return false}}}catch(e_2_1){e_2={error:e_2_1}}finally{try{if(_f&&!_f.done&&(_b=_e.return))_b.call(_e)}finally{if(e_2)throw e_2.error}}return true}function equalSet(left,right){var e_3,_a;if(left.size!==right.size){return false}try{for(var _b=__values(left.entries()),_c=_b.next();!_c.done;_c=_b.next()){var index=_c.value;if(!right.has(index[0])){return false}}}catch(e_3_1){e_3={error:e_3_1}}finally{try{if(_c&&!_c.done&&(_a=_b.return))_a.call(_b)}finally{if(e_3)throw e_3.error}}return true}function equal(left,right){if(left===right){return true}if(left&&isObject(left)&&right&&isObject(right)){if(left.constructor!==right.constructor){return false}if(Array.isArray(left)&&Array.isArray(right)){return equalArray(left,right)}if(left instanceof Map&&right instanceof Map){return equalMap(left,right)}if(left instanceof Set&&right instanceof Set){return equalSet(left,right)}if(ArrayBuffer.isView(left)&&ArrayBuffer.isView(right)){return equalArrayBuffer(left,right)}if(isRegex(left)&&isRegex(right)){return left.source===right.source&&left.flags===right.flags}if(left.valueOf!==Object.prototype.valueOf){return left.valueOf()===right.valueOf()}if(left.toString!==Object.prototype.toString){return left.toString()===right.toString()}var leftKeys=Object.keys(left);var rightKeys=Object.keys(right);if(leftKeys.length!==rightKeys.length){return false}for(var index=leftKeys.length;index--!==0;){if(!Object.prototype.hasOwnProperty.call(right,leftKeys[index])){return false}}for(var index=leftKeys.length;index--!==0;){var key=leftKeys[index];if(key==="_owner"&&left.$$typeof){continue}if(!equal(left[key],right[key])){return false}}return true}if(Number.isNaN(left)&&Number.isNaN(right)){return true}return left===right}var DOM_PROPERTIES_TO_CHECK$1=["innerHTML","ownerDocument","style","attributes","nodeValue"];var objectTypes$1=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"];var primitiveTypes$1=["bigint","boolean","null","number","string","symbol","undefined"];function getObjectType$2(value){var objectTypeName=Object.prototype.toString.call(value).slice(8,-1);if(/HTML\w+Element/.test(objectTypeName)){return"HTMLElement"}if(isObjectType$1(objectTypeName)){return objectTypeName}return void 0}function isObjectOfType$1(type){return function(value){return getObjectType$2(value)===type}}function isObjectType$1(name){return objectTypes$1.includes(name)}function isOfType$1(type){return function(value){return typeof value===type}}function isPrimitiveType$1(name){return primitiveTypes$1.includes(name)}function is$1(value){if(value===null){return"null"}switch(typeof value){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(is$1.array(value)){return"Array"}if(is$1.plainFunction(value)){return"Function"}var tagType=getObjectType$2(value);if(tagType){return tagType}return"Object"}is$1.array=Array.isArray;is$1.arrayOf=function(target,predicate){if(!is$1.array(target)&&!is$1.function(predicate)){return false}return target.every((function(d){return predicate(d)}))};is$1.asyncGeneratorFunction=function(value){return getObjectType$2(value)==="AsyncGeneratorFunction"};is$1.asyncFunction=isObjectOfType$1("AsyncFunction");is$1.bigint=isOfType$1("bigint");is$1.boolean=function(value){return value===true||value===false};is$1.date=isObjectOfType$1("Date");is$1.defined=function(value){return!is$1.undefined(value)};is$1.domElement=function(value){return is$1.object(value)&&!is$1.plainObject(value)&&value.nodeType===1&&is$1.string(value.nodeName)&&DOM_PROPERTIES_TO_CHECK$1.every((function(property){return property in value}))};is$1.empty=function(value){return is$1.string(value)&&value.length===0||is$1.array(value)&&value.length===0||is$1.object(value)&&!is$1.map(value)&&!is$1.set(value)&&Object.keys(value).length===0||is$1.set(value)&&value.size===0||is$1.map(value)&&value.size===0};is$1.error=isObjectOfType$1("Error");is$1.function=isOfType$1("function");is$1.generator=function(value){return is$1.iterable(value)&&is$1.function(value.next)&&is$1.function(value.throw)};is$1.generatorFunction=isObjectOfType$1("GeneratorFunction");is$1.instanceOf=function(instance,class_){if(!instance||!class_){return false}return Object.getPrototypeOf(instance)===class_.prototype};is$1.iterable=function(value){return!is$1.nullOrUndefined(value)&&is$1.function(value[Symbol.iterator])};is$1.map=isObjectOfType$1("Map");is$1.nan=function(value){return Number.isNaN(value)};is$1.null=function(value){return value===null};is$1.nullOrUndefined=function(value){return is$1.null(value)||is$1.undefined(value)};is$1.number=function(value){return isOfType$1("number")(value)&&!is$1.nan(value)};is$1.numericString=function(value){return is$1.string(value)&&value.length>0&&!Number.isNaN(Number(value))};is$1.object=function(value){return!is$1.nullOrUndefined(value)&&(is$1.function(value)||typeof value==="object")};is$1.oneOf=function(target,value){if(!is$1.array(target)){return false}return target.indexOf(value)>-1};is$1.plainFunction=isObjectOfType$1("Function");is$1.plainObject=function(value){if(getObjectType$2(value)!=="Object"){return false}var prototype=Object.getPrototypeOf(value);return prototype===null||prototype===Object.getPrototypeOf({})};is$1.primitive=function(value){return is$1.null(value)||isPrimitiveType$1(typeof value)};is$1.promise=isObjectOfType$1("Promise");is$1.propertyOf=function(target,key,predicate){if(!is$1.object(target)||!key){return false}var value=target[key];if(is$1.function(predicate)){return predicate(value)}return is$1.defined(value)};is$1.regexp=isObjectOfType$1("RegExp");is$1.set=isObjectOfType$1("Set");is$1.string=isOfType$1("string");is$1.symbol=isOfType$1("symbol");is$1.undefined=isOfType$1("undefined");is$1.weakMap=isObjectOfType$1("WeakMap");is$1.weakSet=isObjectOfType$1("WeakSet");function canHaveLength(){var arguments_=[];for(var _i=0;_i<arguments.length;_i++){arguments_[_i]=arguments[_i]}return arguments_.every((function(d){return is$1.string(d)||is$1.array(d)||is$1.plainObject(d)}))}function checkEquality(left,right,value){if(!isSameType(left,right)){return false}if([left,right].every(is$1.array)){return!left.some(hasValue(value))&&right.some(hasValue(value))}if([left,right].every(is$1.plainObject)){return!Object.entries(left).some(hasEntry(value))&&Object.entries(right).some(hasEntry(value))}return right===value}function compareNumbers(previousData,data,options){var actual=options.actual,key=options.key,previous=options.previous,type=options.type;var left=nested(previousData,key);var right=nested(data,key);var changed=[left,right].every(is$1.number)&&(type==="increased"?left<right:left>right);if(!is$1.undefined(actual)){changed=changed&&right===actual}if(!is$1.undefined(previous)){changed=changed&&left===previous}return changed}function compareValues(previousData,data,options){var key=options.key,type=options.type,value=options.value;var left=nested(previousData,key);var right=nested(data,key);var primary=type==="added"?left:right;var secondary=type==="added"?right:left;if(!is$1.nullOrUndefined(value)){if(is$1.defined(primary)){if(is$1.array(primary)||is$1.plainObject(primary)){return checkEquality(primary,secondary,value)}}else{return equal(secondary,value)}return false}if([left,right].every(is$1.array)){return!secondary.every(isEqualPredicate(primary))}if([left,right].every(is$1.plainObject)){return hasExtraKeys(Object.keys(primary),Object.keys(secondary))}return![left,right].every((function(d){return is$1.primitive(d)&&is$1.defined(d)}))&&(type==="added"?!is$1.defined(left)&&is$1.defined(right):is$1.defined(left)&&!is$1.defined(right))}function getIterables(previousData,data,_a){var _b=_a===void 0?{}:_a,key=_b.key;var left=nested(previousData,key);var right=nested(data,key);if(!isSameType(left,right)){throw new TypeError("Inputs have different types")}if(!canHaveLength(left,right)){throw new TypeError("Inputs don't have length")}if([left,right].every(is$1.plainObject)){left=Object.keys(left);right=Object.keys(right)}return[left,right]}function hasEntry(input){return function(_a){var key=_a[0],value=_a[1];if(is$1.array(input)){return equal(input,value)||input.some((function(d){return equal(d,value)||is$1.array(value)&&isEqualPredicate(value)(d)}))}if(is$1.plainObject(input)&&input[key]){return!!input[key]&&equal(input[key],value)}return equal(input,value)}}function hasExtraKeys(left,right){return right.some((function(d){return!left.includes(d)}))}function hasValue(input){return function(value){if(is$1.array(input)){return input.some((function(d){return equal(d,value)||is$1.array(value)&&isEqualPredicate(value)(d)}))}return equal(input,value)}}function includesOrEqualsTo(previousValue,value){return is$1.array(previousValue)?previousValue.some((function(d){return equal(d,value)})):equal(previousValue,value)}function isEqualPredicate(data){return function(value){return data.some((function(d){return equal(d,value)}))}}function isSameType(){var arguments_=[];for(var _i=0;_i<arguments.length;_i++){arguments_[_i]=arguments[_i]}return arguments_.every(is$1.array)||arguments_.every(is$1.number)||arguments_.every(is$1.plainObject)||arguments_.every(is$1.string)}function nested(data,property){if(is$1.plainObject(data)||is$1.array(data)){if(is$1.string(property)){var props=property.split(".");return props.reduce((function(acc,d){return acc&&acc[d]}),data)}if(is$1.number(property)){return data[property]}return data}return data}function treeChanges(previousData,data){if([previousData,data].some(is$1.nullOrUndefined)){throw new Error("Missing required parameters")}if(![previousData,data].every((function(d){return is$1.plainObject(d)||is$1.array(d)}))){throw new Error("Expected plain objects or array")}var added=function(key,value){try{return compareValues(previousData,data,{key:key,type:"added",value:value})}catch(_a){return false}};var changed=function(key,actual,previous){try{var left=nested(previousData,key);var right=nested(data,key);var hasActual=is$1.defined(actual);var hasPrevious=is$1.defined(previous);if(hasActual||hasPrevious){var leftComparator=hasPrevious?includesOrEqualsTo(previous,left):!includesOrEqualsTo(actual,left);var rightComparator=includesOrEqualsTo(actual,right);return leftComparator&&rightComparator}if([left,right].every(is$1.array)||[left,right].every(is$1.plainObject)){return!equal(left,right)}return left!==right}catch(_a){return false}};var changedFrom=function(key,previous,actual){if(!is$1.defined(key)){return false}try{var left=nested(previousData,key);var right=nested(data,key);var hasActual=is$1.defined(actual);return includesOrEqualsTo(previous,left)&&(hasActual?includesOrEqualsTo(actual,right):!hasActual)}catch(_a){return false}};var changedTo=function(key,actual){if(!is$1.defined(key)){return false}return changed(key,actual)};var decreased=function(key,actual,previous){if(!is$1.defined(key)){return false}try{return compareNumbers(previousData,data,{key:key,actual:actual,previous:previous,type:"decreased"})}catch(_a){return false}};var emptied=function(key){try{var _a=getIterables(previousData,data,{key:key}),left=_a[0],right=_a[1];return!!left.length&&!right.length}catch(_b){return false}};var filled=function(key){try{var _a=getIterables(previousData,data,{key:key}),left=_a[0],right=_a[1];return!left.length&&!!right.length}catch(_b){return false}};var increased=function(key,actual,previous){if(!is$1.defined(key)){return false}try{return compareNumbers(previousData,data,{key:key,actual:actual,previous:previous,type:"increased"})}catch(_a){return false}};var removed=function(key,value){try{return compareValues(previousData,data,{key:key,type:"removed",value:value})}catch(_a){return false}};return{added:added,changed:changed,changedFrom:changedFrom,changedTo:changedTo,decreased:decreased,emptied:emptied,filled:filled,increased:increased,removed:removed}}var DOM_PROPERTIES_TO_CHECK=["innerHTML","ownerDocument","style","attributes","nodeValue"];var objectTypes=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"];var primitiveTypes=["bigint","boolean","null","number","string","symbol","undefined"];function getObjectType$1(value){const objectTypeName=Object.prototype.toString.call(value).slice(8,-1);if(/HTML\w+Element/.test(objectTypeName)){return"HTMLElement"}if(isObjectType(objectTypeName)){return objectTypeName}return void 0}function isObjectOfType(type){return value=>getObjectType$1(value)===type}function isObjectType(name){return objectTypes.includes(name)}function isOfType(type){return value=>typeof value===type}function isPrimitiveType(name){return primitiveTypes.includes(name)}function is(value){if(value===null){return"null"}switch(typeof value){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(is.array(value)){return"Array"}if(is.plainFunction(value)){return"Function"}const tagType=getObjectType$1(value);if(tagType){return tagType}return"Object"}is.array=Array.isArray;is.arrayOf=(target,predicate)=>{if(!is.array(target)&&!is.function(predicate)){return false}return target.every((d=>predicate(d)))};is.asyncGeneratorFunction=value=>getObjectType$1(value)==="AsyncGeneratorFunction";is.asyncFunction=isObjectOfType("AsyncFunction");is.bigint=isOfType("bigint");is.boolean=value=>value===true||value===false;is.date=isObjectOfType("Date");is.defined=value=>!is.undefined(value);is.domElement=value=>is.object(value)&&!is.plainObject(value)&&value.nodeType===1&&is.string(value.nodeName)&&DOM_PROPERTIES_TO_CHECK.every((property=>property in value));is.empty=value=>is.string(value)&&value.length===0||is.array(value)&&value.length===0||is.object(value)&&!is.map(value)&&!is.set(value)&&Object.keys(value).length===0||is.set(value)&&value.size===0||is.map(value)&&value.size===0;is.error=isObjectOfType("Error");is.function=isOfType("function");is.generator=value=>is.iterable(value)&&is.function(value.next)&&is.function(value.throw);is.generatorFunction=isObjectOfType("GeneratorFunction");is.instanceOf=(instance,class_)=>{if(!instance||!class_){return false}return Object.getPrototypeOf(instance)===class_.prototype};is.iterable=value=>!is.nullOrUndefined(value)&&is.function(value[Symbol.iterator]);is.map=isObjectOfType("Map");is.nan=value=>Number.isNaN(value);is.null=value=>value===null;is.nullOrUndefined=value=>is.null(value)||is.undefined(value);is.number=value=>isOfType("number")(value)&&!is.nan(value);is.numericString=value=>is.string(value)&&value.length>0&&!Number.isNaN(Number(value));is.object=value=>!is.nullOrUndefined(value)&&(is.function(value)||typeof value==="object");is.oneOf=(target,value)=>{if(!is.array(target)){return false}return target.indexOf(value)>-1};is.plainFunction=isObjectOfType("Function");is.plainObject=value=>{if(getObjectType$1(value)!=="Object"){return false}const prototype=Object.getPrototypeOf(value);return prototype===null||prototype===Object.getPrototypeOf({})};is.primitive=value=>is.null(value)||isPrimitiveType(typeof value);is.promise=isObjectOfType("Promise");is.propertyOf=(target,key,predicate)=>{if(!is.object(target)||!key){return false}const value=target[key];if(is.function(predicate)){return predicate(value)}return is.defined(value)};is.regexp=isObjectOfType("RegExp");is.set=isObjectOfType("Set");is.string=isOfType("string");is.symbol=isOfType("symbol");is.undefined=isOfType("undefined");is.weakMap=isObjectOfType("WeakMap");is.weakSet=isObjectOfType("WeakSet");var src_default=is;var E_NOSCROLL=new Error("Element already at target scroll position");var E_CANCELLED=new Error("Scroll cancelled");var min=Math.min;var ms=Date.now;var scroll={left:make("scrollLeft"),top:make("scrollTop")};function make(prop){return function scroll2(el,to,opts,cb){opts=opts||{};if(typeof opts=="function")cb=opts,opts={};if(typeof cb!="function")cb=noop$1;var start=ms();var from=el[prop];var ease=opts.ease||inOutSine;var duration=!isNaN(opts.duration)?+opts.duration:350;var cancelled=false;return from===to?cb(E_NOSCROLL,el[prop]):requestAnimationFrame(animate2),cancel;function cancel(){cancelled=true}function animate2(timestamp){if(cancelled)return cb(E_CANCELLED,el[prop]);var now=ms();var time=min(1,(now-start)/duration);var eased=ease(time);el[prop]=eased*(to-from)+from;time<1?requestAnimationFrame(animate2):requestAnimationFrame((function(){cb(null,el[prop])}))}}}function inOutSine(n){return.5*(1-Math.cos(Math.PI*n))}function noop$1(){}const scroll$1=getDefaultExportFromCjs(scroll);var scrollparent={exports:{}};(function(module){(function(root,factory){if(module.exports){module.exports=factory()}else{root.Scrollparent=factory()}})(commonjsGlobal,(function(){var regex=/(auto|scroll)/;var parents=function(node,ps){if(node.parentNode===null){return ps}return parents(node.parentNode,ps.concat([node]))};var style=function(node,prop){return getComputedStyle(node,null).getPropertyValue(prop)};var overflow=function(node){return style(node,"overflow")+style(node,"overflow-y")+style(node,"overflow-x")};var scroll2=function(node){return regex.test(overflow(node))};var scrollParent2=function(node){if(!(node instanceof HTMLElement||node instanceof SVGElement)){return}var ps=parents(node.parentNode,[]);for(var i=0;i<ps.length;i+=1){if(scroll2(ps[i])){return ps[i]}}return document.scrollingElement||document.documentElement};return scrollParent2}))})(scrollparent);var scrollparentExports=scrollparent.exports;const scrollParent=getDefaultExportFromCjs(scrollparentExports);var isMergeableObject=function isMergeableObject2(value){return isNonNullObject(value)&&!isSpecial(value)};function isNonNullObject(value){return!!value&&typeof value==="object"}function isSpecial(value){var stringValue=Object.prototype.toString.call(value);return stringValue==="[object RegExp]"||stringValue==="[object Date]"||isReactElement(value)}var canUseSymbol=typeof Symbol==="function"&&Symbol.for;var REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(value){return value.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(val){return Array.isArray(val)?[]:{}}function cloneUnlessOtherwiseSpecified(value,options){return options.clone!==false&&options.isMergeableObject(value)?deepmerge(emptyTarget(value),value,options):value}function defaultArrayMerge(target,source,options){return target.concat(source).map((function(element){return cloneUnlessOtherwiseSpecified(element,options)}))}function getMergeFunction(key,options){if(!options.customMerge){return deepmerge}var customMerge=options.customMerge(key);return typeof customMerge==="function"?customMerge:deepmerge}function getEnumerableOwnPropertySymbols(target){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(target).filter((function(symbol){return target.propertyIsEnumerable(symbol)})):[]}function getKeys(target){return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))}function propertyIsOnObject(object,property){try{return property in object}catch(_){return false}}function propertyIsUnsafe(target,key){return propertyIsOnObject(target,key)&&!(Object.hasOwnProperty.call(target,key)&&Object.propertyIsEnumerable.call(target,key))}function mergeObject(target,source,options){var destination={};if(options.isMergeableObject(target)){getKeys(target).forEach((function(key){destination[key]=cloneUnlessOtherwiseSpecified(target[key],options)}))}getKeys(source).forEach((function(key){if(propertyIsUnsafe(target,key)){return}if(propertyIsOnObject(target,key)&&options.isMergeableObject(source[key])){destination[key]=getMergeFunction(key,options)(target[key],source[key],options)}else{destination[key]=cloneUnlessOtherwiseSpecified(source[key],options)}}));return destination}function deepmerge(target,source,options){options=options||{};options.arrayMerge=options.arrayMerge||defaultArrayMerge;options.isMergeableObject=options.isMergeableObject||isMergeableObject;options.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var sourceIsArray=Array.isArray(source);var targetIsArray=Array.isArray(target);var sourceAndTargetTypesMatch=sourceIsArray===targetIsArray;if(!sourceAndTargetTypesMatch){return cloneUnlessOtherwiseSpecified(source,options)}else if(sourceIsArray){return options.arrayMerge(target,source,options)}else{return mergeObject(target,source,options)}}deepmerge.all=function deepmergeAll(array,options){if(!Array.isArray(array)){throw new Error("first argument should be an array")}return array.reduce((function(prev,next){return deepmerge(prev,next,options)}),{})};var deepmerge_1=deepmerge;var cjs=deepmerge_1;const deepmerge$1=getDefaultExportFromCjs(cjs);var isRequiredIf$1={};Object.defineProperty(isRequiredIf$1,"__esModule",{value:true});var VALIDATOR_ARG_ERROR_MESSAGE="The typeValidator argument must be a function with the signature function(props, propName, componentName).",MESSAGE_ARG_ERROR_MESSAGE="The error message is optional, but must be a string if provided.",propIsRequired=function propIsRequired2(a,b,c,d){if("boolean"==typeof a)return a;return"function"==typeof a?a(b,c,d):!(true!==!!a)&&!!a},propExists=function propExists2(a,b){return Object.hasOwnProperty.call(a,b)},missingPropError=function missingPropError2(a,b,c,d){return d?new Error(d):new Error("Required "+a[b]+" `"+b+"`"+(" was not specified in `"+c+"`."))},guardAgainstInvalidArgTypes=function guardAgainstInvalidArgTypes2(a,b){if("function"!=typeof a)throw new TypeError(VALIDATOR_ARG_ERROR_MESSAGE);if(!!b&&"string"!=typeof b)throw new TypeError(MESSAGE_ARG_ERROR_MESSAGE)},isRequiredIf=function isRequiredIf2(a,b,c){return guardAgainstInvalidArgTypes(a,c),function(d,e,f){for(var _len=arguments.length,g=Array(3<_len?_len-3:0),_key=3;_key<_len;_key++)g[_key-3]=arguments[_key];return propIsRequired(b,d,e,f)?propExists(d,e)?a.apply(void 0,[d,e,f].concat(g)):missingPropError(d,e,f,c):a.apply(void 0,[d,e,f].concat(g))}};var _default=isRequiredIf$1.default=isRequiredIf;
|
21
|
+
*/function flexRender(Comp,props){return!Comp?null:isReactComponent(Comp)?React.createElement(Comp,props):Comp}function isReactComponent(component){return isClassComponent(component)||typeof component==="function"||isExoticComponent(component)}function isClassComponent(component){return typeof component==="function"&&(()=>{const proto=Object.getPrototypeOf(component);return proto.prototype&&proto.prototype.isReactComponent})()}function isExoticComponent(component){return typeof component==="object"&&typeof component.$$typeof==="symbol"&&["react.memo","react.forward_ref"].includes(component.$$typeof.description)}function useReactTable(options){const resolvedOptions={state:{},onStateChange:()=>{},renderFallbackValue:null,...options};const[tableRef]=React.useState((()=>({current:createTable(resolvedOptions)})));const[state,setState]=React.useState((()=>tableRef.current.initialState));tableRef.current.setOptions((prev=>({...prev,...options,state:{...state,...options.state},onStateChange:updater=>{setState(updater);options.onStateChange==null?void 0:options.onStateChange(updater)}})));return tableRef.current}const TableHead=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,tag:tag="table"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames("pb_table_thead",globalProps(props),className);const isTableTag=tag==="table";return jsx(Fragment,{children:isTableTag?jsx("thead",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children})})};const TableHeader$1=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,tag:tag="table",text:text2}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames("pb_table_th",globalProps(props),className);const isTableTag=tag==="table";return jsx(Fragment,{children:isTableTag?jsx("th",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:text2||children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:text2||children})})};const TableBody$1=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,tag:tag="table"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames("pb_table_tbody",globalProps(props),className);const isTableTag=tag==="table";return jsx(Fragment,{children:isTableTag?jsx("tbody",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children})})};const TableRow=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,sideHighlightColor:sideHighlightColor="none",tag:tag="table"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const sideHighlightClass=sideHighlightColor!=""?`side_highlight_${sideHighlightColor}`:null;const classes=classnames(buildCss("pb_table_row_kit",sideHighlightClass),"pb_table_tr",globalProps(props),className);const isTableTag=tag==="table";return jsx(Fragment,{children:isTableTag?jsx("tr",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children})})};const TableCell=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,tag:tag="table",text:text2}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames("pb_table_td",globalProps(props),className);const isTableTag=tag==="table";return jsx(Fragment,{children:isTableTag?jsx("td",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:text2||children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:text2||children})})};const Table=props=>{const{aria:aria={},children:children,className:className,collapse:collapse="sm",container:container=true,dark:dark,data:data={},dataTable:dataTable=false,disableHover:disableHover=false,htmlOptions:htmlOptions={},id:id,outerPadding:outerPadding="",responsive:responsive="collapse",singleLine:singleLine=false,size:size="sm",sticky:sticky=false,striped:striped=false,tag:tag="table",verticalBorder:verticalBorder=false}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const tableCollapseCss=responsive!=="none"?`table-collapse-${collapse}`:"";const verticalBorderCss=verticalBorder?"vertical-border":"";const spaceCssName=outerPadding!=="none"?"space_":"";const outerPaddingCss=outerPadding?`outer_padding_${spaceCssName}${outerPadding}`:"";const isTableTag=tag==="table";const classNames=classnames("pb_table",`table-${size}`,`table-responsive-${responsive}`,{"table-card":container,"table-dark":dark,data_table:dataTable,"single-line":singleLine,"no-hover":disableHover,"sticky-header":sticky,striped:striped,[outerPaddingCss]:outerPadding!==""},globalProps(props),tableCollapseCss,verticalBorderCss,className);useEffect((()=>{const instance=new PbTable;instance.connect()}),[]);return jsx(Fragment,{children:isTableTag?jsx("table",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,children:children})})};Table.Head=TableHead;Table.Header=TableHeader$1;Table.Body=TableBody$1;Table.Row=TableRow;Table.Cell=TableCell;const AdvancedTableContext=createContext({});const filterExpandableRows=expandedState=>{for(const expandedRow in expandedState){if(expandedState[expandedRow]===false){delete expandedState[expandedRow]}}return expandedState};const updateExpandAndCollapseState=(tableRows,expanded,targetParent)=>{const updateExpandedRows={};const rows=tableRows.rows;let isExpansionConsistent=true;const areRowsExpanded=new Set;for(const row of rows){const shouldBeUpdated=targetParent===void 0?row.depth===0:targetParent===row.parentId;if(shouldBeUpdated){const isExpanded=row.getIsExpanded();areRowsExpanded.add(isExpanded);updateExpandedRows[row.id]=!isExpansionConsistent?true:!isExpanded;if(areRowsExpanded.size>1){isExpansionConsistent=false;for(const key in updateExpandedRows){updateExpandedRows[key]=true}}}}return filterExpandableRows({...expanded,...updateExpandedRows})};const CustomCell=({getValue:getValue,onRowToggleClick:onRowToggleClick,row:row,value:value})=>{const{setExpanded:setExpanded,expanded:expanded,expandedControl:expandedControl,inlineRowLoading:inlineRowLoading}=useContext(AdvancedTableContext);const handleOnExpand=row2=>{onRowToggleClick&&onRowToggleClick(row2);if(!expandedControl){setExpanded({...expanded,[row2.id]:!row2.getIsExpanded()})}};const RowHasChildren=row.original.children?true:false;const renderButton=inlineRowLoading?RowHasChildren:row.getCanExpand();return jsx("div",{style:{paddingLeft:`${row.depth*1.25}em`},children:jsxs(Flex,{alignItems:"center",columnGap:"xs",orientation:"row",children:[renderButton?jsx("button",{className:"gray-icon expand-toggle-icon",onClick:()=>handleOnExpand(row),children:row.getIsExpanded()?jsx(Icon,{cursor:"pointer",icon:"circle-play",rotation:90}):jsx(Icon,{cursor:"pointer",icon:"circle-play"})}):null,jsx(FlexItem,{paddingLeft:renderButton?"none":"xs",children:row.depth===0?getValue():value})]})})};const displayIcon=icon=>{if(typeof icon==="string"){return[icon,icon]}return icon};const SortIconButton=({header:header,sortIcon:sortIcon})=>jsx(Fragment,{children:header.column.getIsSorted()==="desc"?jsx("div",{className:"sort-button-icon",children:jsx(Icon,{icon:displayIcon(sortIcon)[0]})},displayIcon(sortIcon)[0]):jsx("div",{className:"sort-button-icon",children:jsx(Icon,{icon:displayIcon(sortIcon)[1]})},displayIcon(sortIcon)[1])});const ToggleIconButton=({row:row,onClick:onClick})=>{const{toggleExpansionIcon:toggleExpansionIcon}=useContext(AdvancedTableContext);return jsx("button",{className:"gray-icon toggle-all-icon",onClick:()=>onClick(row),children:jsx(Icon,{cursor:"pointer",fixedWidth:true,icon:displayIcon(toggleExpansionIcon)[0]})},displayIcon(toggleExpansionIcon)[0])};const isChrome=()=>{const userAgent=navigator.userAgent.toLowerCase();return userAgent.includes("chrome")&&!userAgent.includes("edg")};const TableHeaderCell=({enableSorting:enableSorting,enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,header:header,headerChildren:headerChildren,loading:loading,sortIcon:sortIcon})=>{const{sortControl:sortControl}=useContext(AdvancedTableContext);const toggleSortButton=event=>{if(sortControl){const sortIsDesc=header.column.getIsSorted()==="desc";sortIsDesc?sortControl.onChange({desc:true}):sortControl.onChange({desc:false})}else{header.column.getToggleSortingHandler()(event)}};const cellClassName=classnames("table-header-cells",`${isChrome()?"chrome-styles":""}`,`${enableSorting?"table-header-cells-active":""}`);const cellId=`${loading?`loading-${header.id}`:`${header.id}`}`;const isToggleExpansionEnabledLoading=header.index===0&&loading&&(enableToggleExpansion==="all"||"header")&&enableToggleExpansion!=="none";const isToggleExpansionEnabled=header.index===0&&!loading&&(enableToggleExpansion==="all"||"header")&&enableToggleExpansion!=="none";return jsx("th",{align:"right",className:cellClassName,id:cellId,children:header.isPlaceholder?null:headerChildren&&header.index===0?jsxs(Flex,{alignItems:"center",children:[headerChildren,jsx("div",{children:flexRender(header.column.columnDef.header,header.getContext())})]}):jsxs(Flex,{alignItems:"center",justify:header.index===0&&enableSorting?"between":header.index===0&&!enableSorting?"start":"end",children:[isToggleExpansionEnabled&&jsx(ToggleIconButton,{onClick:handleExpandOrCollapse}),isToggleExpansionEnabledLoading&&jsx("div",{className:"loading-toggle-icon header-toggle-icon"}),jsxs(Flex,{className:`${header.index===0&&enableSorting&&"header-sort-button pb_th_link"}`,cursor:header.index===0&&enableSorting?"pointer":"default",...header.index===0&&enableSorting&&{htmlOptions:{onClick:event=>toggleSortButton(event),onKeyDown:event=>{if(event.key==="Enter"){toggleSortButton(event)}},tabIndex:0}},justify:header.index===0&&enableSorting?"between":"none",paddingLeft:enableSorting?"xxs":"xs",children:[jsx("div",{children:flexRender(header.column.columnDef.header,header.getContext())}),header.index===0&&header.column.getCanSort()&&enableSorting&&(loading?jsx("div",{className:"loading-toggle-icon"}):jsx(SortIconButton,{header:header,sortIcon:sortIcon}))]})]})},`${header.id}-header`)};const TableHeader=({children:children,className:className,dark:dark=false,enableSorting:enableSorting=false,id:id,sortIcon:sortIcon=["arrow-up-short-wide","arrow-down-short-wide"],...props})=>{const{enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,loading:loading,table:table}=useContext(AdvancedTableContext);const classes=classnames(buildCss("pb_advanced_table_header"),globalProps(props),className);return jsx(Fragment,{children:jsx("thead",{className:classes,id:id,children:table.getHeaderGroups().map((headerGroup=>jsx("tr",{children:headerGroup.headers.map((header=>jsx(TableHeaderCell,{enableSorting:enableSorting,enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,header:header,headerChildren:children,loading:loading,sortIcon:sortIcon},`${header.id}-header`)))},`${headerGroup.id}-headerGroup`)))})})};const LoadingInline=props=>{const{align:align="left",aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,text:text2=" Loading"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss(`pb_loading_inline_kit_${align}`),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs(Body$1,{color:"light",children:[jsx(Icon,{aria:{label:"loading icon"},fixedWidth:true,icon:"spinner",pulse:true}),text2]})})};const CollapsibleTrail=({leftOffset:leftOffset})=>{const style={position:"absolute",left:`${leftOffset}em`,top:0,bottom:0,width:"2px",backgroundColor:"#E4E8F0"};return jsx("div",{className:"collapsible-trail",style:style})};const renderCollapsibleTrail=currentDepth=>{const lines=[];for(let i=1;i<=currentDepth;i++){const additionalOffset=i>1?(i-1)*.25:0;const leftOffset=i*1+additionalOffset;lines.push(jsx(CollapsibleTrail,{leftOffset:leftOffset},i))}return lines};const SubRowHeaderRow=({collapsibleTrail:collapsibleTrail,enableToggleExpansion:enableToggleExpansion,onClick:onClick,row:row,subRowHeaders:subRowHeaders,table:table})=>{const{inlineRowLoading:inlineRowLoading}=useContext(AdvancedTableContext);const numberOfColumns=table.getAllFlatColumns().length;const rowHasChildren=row.original.children?true:false;const canExpand=inlineRowLoading?rowHasChildren:row.getCanExpand();return jsxs("tr",{className:"custom-row bg-silver",children:[jsxs("td",{className:`custom-row-first-column ${isChrome()?"chrome-styles":""}`,colSpan:1,children:[collapsibleTrail&&row.depth>0&&renderCollapsibleTrail(row.depth),jsx("div",{style:{paddingLeft:`${row.depth*1.25}em`},children:jsxs(Flex,{align:"center",columnGap:"xs",children:[enableToggleExpansion==="all"&&canExpand?jsx(ToggleIconButton,{onClick:onClick,row:row}):null,jsx(Caption,{marginLeft:canExpand?"none":"xs",text:subRowHeaders[row.depth-1]})]})})]}),jsx("td",{colSpan:numberOfColumns-1})]})};const LoadingCell=()=>jsx("div",{className:"loading-cell"});const TableBody=({className:className,collapsibleTrail:collapsibleTrail=true,dark:dark=false,id:id,subRowHeaders:subRowHeaders,...props})=>{const{columnDefinitions:columnDefinitions,enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,inlineRowLoading:inlineRowLoading,loading:loading,table:table}=useContext(AdvancedTableContext);const classes=classnames(buildCss("pb_advanced_table_body"),globalProps(props),className);return jsx(Fragment,{children:jsx("tbody",{className:classes,id:id,children:table.getRowModel().rows.map((row=>{var _a;const isExpandable=row.getIsExpanded();const isFirstChildofSubrow=row.depth>0&&row.index===0;const rowHasNoChildren=row.original.children&&!row.original.children.length?true:false;const numberOfColumns=table.getAllFlatColumns().length;const isDataLoading=isExpandable&&(inlineRowLoading&&rowHasNoChildren)&&row.depth<((_a=columnDefinitions[0].cellAccessors)==null?void 0:_a.length);const rowBackground=isExpandable&&(!inlineRowLoading&&row.getCanExpand()||inlineRowLoading&&rowHasNoChildren);return jsxs(React__default.Fragment,{children:[isFirstChildofSubrow&&subRowHeaders&&jsx(SubRowHeaderRow,{collapsibleTrail:collapsibleTrail,enableToggleExpansion:enableToggleExpansion,onClick:handleExpandOrCollapse,row:row,subRowHeaders:subRowHeaders,table:table}),jsx("tr",{className:`${rowBackground?"bg-silver":"bg-white"} ${row.depth>0?`depth-sub-row-${row.depth}`:""}`,id:`${row.index}-${row.id}-${row.depth}-row`,children:row.getVisibleCells().map(((cell,i)=>jsxs("td",{align:"right",className:`${cell.id}-cell position_relative ${isChrome()?"chrome-styles":""}`,children:[collapsibleTrail&&i===0&&row.depth>0&&renderCollapsibleTrail(row.depth),jsx("span",{id:`${cell.id}-span`,children:loading?jsx(LoadingCell,{}):flexRender(cell.column.columnDef.cell,cell.getContext())})]},`${cell.id}-data`)))}),isDataLoading?jsx("tr",{children:jsx("td",{colSpan:numberOfColumns,style:{paddingLeft:`${row.depth===0?.5:row.depth*2}em`},children:jsx(LoadingInline,{})})},`${row.id}-row`):null]},`${row.index}-${row.id}-${row.depth}-row`)}))})})};const AdvancedTable=props=>{const{aria:aria={},children:children,className:className,columnDefinitions:columnDefinitions,dark:dark=false,data:data={},enableToggleExpansion:enableToggleExpansion="header",expandedControl:expandedControl,htmlOptions:htmlOptions={},id:id,initialLoadingRowsCount:initialLoadingRowsCount=10,inlineRowLoading:inlineRowLoading=false,loading:loading,onRowToggleClick:onRowToggleClick,onToggleExpansionClick:onToggleExpansionClick,sortControl:sortControl,tableData:tableData,tableOptions:tableOptions,tableProps:tableProps,toggleExpansionIcon:toggleExpansionIcon="arrows-from-line"}=props;const[loadingStateRowCount,setLoadingStateRowCount]=useState(initialLoadingRowsCount);const[localExpanded,setLocalExpanded]=useState({});const expanded=expandedControl?expandedControl.value:localExpanded;const setExpanded=expandedControl?expandedControl.onChange:setLocalExpanded;const columnHelper=createColumnHelper();const createCellFunction=cellAccessors=>{const columnCells=({row:row,getValue:getValue})=>{const rowData=row.original;switch(row.depth){case 0:{return jsx(CustomCell,{getValue:getValue,onRowToggleClick:onRowToggleClick,row:row})}default:{const depthAccessor=cellAccessors[row.depth-1];const accessorValue=rowData[depthAccessor];return accessorValue?jsx(CustomCell,{onRowToggleClick:onRowToggleClick,row:row,value:accessorValue}):"N/A"}}};return columnCells};const columns=columnDefinitions&&columnDefinitions.map((column=>{const columnStructure={...columnHelper.accessor(column.accessor,{header:column.label})};if(column.cellAccessors){columnStructure.cell=createCellFunction(column.cellAccessors)}return columnStructure}));const sorting=[{id:columnDefinitions[0].accessor,desc:sortControl&&sortControl.value!==null?!sortControl.value.desc:false}];const expandAndSortState=()=>{if(sortControl){return{state:{expanded:expanded,sorting:sorting}}}else{return{state:{expanded:expanded}}}};const table=useReactTable({data:loading?Array(loadingStateRowCount).fill({}):tableData,columns:columns,onExpandedChange:setExpanded,getSubRows:row=>row.children,getCoreRowModel:getCoreRowModel(),getExpandedRowModel:getExpandedRowModel(),getSortedRowModel:getSortedRowModel(),enableSortingRemoval:false,sortDescFirst:true,...expandAndSortState(),...tableOptions});const tableRows=table.getRowModel();const updateLoadingStateRowCount=useCallback((()=>{const rowsCount=table.getRowModel().rows.length;if(rowsCount!==loadingStateRowCount&&rowsCount!==0){setLoadingStateRowCount(rowsCount)}}),[tableData,loadingStateRowCount]);useEffect((()=>{if(!loading){updateLoadingStateRowCount()}}),[loading,updateLoadingStateRowCount]);const handleExpandOrCollapse=async row=>{onToggleExpansionClick&&onToggleExpansionClick(row);const expandedState=expanded;const targetParent=row==null?void 0:row.parentId;const updatedRows=await updateExpandAndCollapseState(tableRows,expandedState,targetParent);setExpanded(updatedRows)};const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_advanced_table"),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsx(AdvancedTableContext.Provider,{value:{columnDefinitions:columnDefinitions,enableToggleExpansion:enableToggleExpansion,expanded:expanded,expandedControl:expandedControl,handleExpandOrCollapse:handleExpandOrCollapse,inlineRowLoading:inlineRowLoading,loading:loading,setExpanded:setExpanded,sortControl:sortControl,table:table,toggleExpansionIcon:toggleExpansionIcon},children:jsx(Table,{className:`${loading?"content-loading":""}`,dark:dark,dataTable:true,numberSpacing:"tabular",responsive:"none",...tableProps,children:children?children:jsxs(Fragment,{children:[jsx(TableHeader,{}),jsx(TableBody,{})]})})})})};AdvancedTable.Header=TableHeader;AdvancedTable.Body=TableBody;const AvatarActionButton=props=>{const{action:action="add",aria:aria={},linkAriaLabel:linkAriaLabel,className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},id:id,imageAlt:imageAlt="",imageUrl:imageUrl,linkUrl:linkUrl,name:name,onClick:onClick,placement:placement="bottom left",size:size="md"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_avatar_action_button_kit",action,placement,size),globalProps(props),className);const icons={add:"plus-circle",remove:"times-circle"};return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs("a",{"aria-label":linkAriaLabel,href:linkUrl,onClick:onClick,children:[jsx(Avatar,{imageAlt:imageAlt,imageUrl:imageUrl,name:name,size:size}),jsx("div",{className:`icon ${dark?"dark":""}`,children:jsx(Icon,{dark:dark,icon:icons[action]})})]})})};const BreadCrumbItem=props=>{const{aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,component:component="a",...rest}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const Component=component||"span";const css=classnames(buildCss("pb_bread_crumb_item_kit"),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:css,id:id,children:jsx(Component,{className:"pb_bread_crumb_item",...domSafeProps(rest)})})};const BreadCrumbs=props=>{const{aria:aria={label:"Breadcrumb Navigation"},className:className,data:data={},htmlOptions:htmlOptions={},id:id,children:children}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const css=classnames(buildCss("pb_bread_crumbs_kit"),globalProps(props),className);return jsx("nav",{...ariaProps,...dataProps,...htmlProps,className:css,id:id,children:children})};const ButtonToolbar=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,orientation:orientation="horizontal",text:text2,variant:variant="primary"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_button_toolbar_kit",orientation,variant),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children||text2})};const contactTypeMap={cell:"mobile",email:"envelope",extension:"phone-plus",home:"phone",work:"phone-office","work-cell":"phone-laptop","wrong-phone":"phone-slash"};const formatContact=(contactString,contactType)=>{if(contactType==="email")return contactString;const cleaned=contactString.replace(/\D/g,"");const phoneNumber=cleaned.match(/^(1|)?(\d{3})(\d{3})(\d{4})$/);if(contactType==="extension"){return cleaned.match(/^\d{4}$/)}if(phoneNumber){const intlCode=phoneNumber[1]?"+1 ":"";return[intlCode,"(",phoneNumber[2],") ",phoneNumber[3],"-",phoneNumber[4]].join("")}return null};const Contact=props=>{const{aria:aria={},className:className,contactDetail:contactDetail,contactType:contactType,contactValue:contactValue,data:data={},dark:dark=false,htmlOptions:htmlOptions={},id:id}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_contact_kit"),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs(Body$1,{className:"pb_contact_kit",color:"light",dark:dark,tag:"span",children:[jsx(Icon,{dark:dark,fixedWidth:true,icon:contactTypeMap[contactType]||"phone"}),` ${formatContact(contactValue,contactType)} `,contactDetail&&jsx(Caption,{dark:dark,size:"xs",tag:"span",text:contactDetail})]})})};const sizes$1={lg:1,md:3,sm:4};const Currency=props=>{const{abbreviate:abbreviate=false,align:align="left",aria:aria={},amount:amount,data:data={},decimals:decimals="default",emphasized:emphasized=true,htmlOptions:htmlOptions={},id:id,unit:unit,className:className,label:label="",size:size="sm",symbol:symbol="$",variant:variant="default",dark:dark=false,unstyled:unstyled=false}=props;const emphasizedClass=emphasized?"":"_deemphasized";let variantClass;if(variant==="light"){variantClass="_light"}else if(variant==="bold"){variantClass="_bold"}const[whole,decimal="00"]=amount.split(".");const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_currency_kit",align,size),globalProps(props),className);const getFormattedNumber=input=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(input);const getAbbreviatedValue=abbrType=>{const num=`${getFormattedNumber(whole.split(",").join(""))}`,isAmount=abbrType==="amount",isUnit=abbrType==="unit";return isAmount?num.slice(0,-1):isUnit?num.slice(-1):""};const getMatchingDecimalAmount=decimals==="matching"?amount:whole,getMatchingDecimalValue=decimals==="matching"?"":`.${decimal}`;const getAmount=abbreviate?getAbbreviatedValue("amount"):getMatchingDecimalAmount,getAbbreviation=abbreviate?getAbbreviatedValue("unit"):null,getDecimalValue=abbreviate?"":getMatchingDecimalValue;return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[jsx(Caption,{dark:dark,children:label}),jsx("div",{className:`pb_currency_wrapper${variantClass||emphasizedClass}`,children:unstyled?jsxs(Fragment,{children:[jsx("div",{children:symbol}),jsx("div",{children:getAmount}),jsxs("div",{children:[getAbbreviation,unit?unit:getDecimalValue]})]}):jsxs(Fragment,{children:[jsx(Body$1,{className:"dollar_sign",color:"light",dark:dark,children:symbol}),jsx(Title,{className:"pb_currency_value",dark:dark,size:sizes$1[size],children:getAmount}),jsxs(Body$1,{className:"unit",color:"light",dark:dark,children:[getAbbreviation,unit?unit:getDecimalValue]})]})})]})};const statusMap={increase:"positive",decrease:"negative",neutral:"neutral"};const iconMap$1={increase:"arrow-up",decrease:"arrow-down"};const StatChange=props=>{const{change:change="neutral",className:className,htmlOptions:htmlOptions={},icon:icon,id:id,value:value}=props;const status=statusMap[change];let returnedIcon=iconMap$1[change];if(icon){returnedIcon=icon}const htmlProps=buildHtmlProps(htmlOptions);return jsx(Fragment,{children:value&&jsx("div",{className:classnames(buildCss("pb_stat_change_kit",status),globalProps(props),className),id:id,...htmlProps,children:jsxs(Body$1,{status:status,children:[returnedIcon&&jsxs(Fragment,{children:[jsx(Icon,{fixed_width:true,icon:returnedIcon})," "]}),`${value}%`]})})})};const StatValue=props=>{const{className:className,htmlOptions:htmlOptions={},id:id,unit:unit,value:value=0}=props;const htmlProps=buildHtmlProps(htmlOptions);const displayValue=function(value2){if(value2||value2===0){return jsx(Title,{size:1,tag:"span",text:`${value2}`})}};const displayUnit=function(unit2){if(unit2){return jsx(Title,{size:3,tag:"span",text:unit2})}};return jsx("div",{className:classnames("pb_stat_value_kit",globalProps(props),className),id:id,...htmlProps,children:jsxs("div",{className:"pb_stat_value_wrapper",children:[displayValue(value)," ",displayUnit(unit)]})})};const DashboardValue=props=>{const{align:align="left",aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,statChange:statChange={},statLabel:statLabel,statValue:statValue={}}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_dashboard_value_kit",align),globalProps(props),className);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[statLabel&&jsx(Body$1,{color:"light",children:statLabel}),statValue&&jsx(StatValue,{unit:statValue.unit,value:statValue.value}),statChange&&jsx(StatChange,{change:statChange.change,value:statChange.value})]})};const PbDate=props=>{const{aria:aria={},alignment:alignment="left",className:className,data:data={},htmlOptions:htmlOptions={},id:id,showDayOfWeek:showDayOfWeek=false,showIcon:showIcon=false,size:size="md",unstyled:unstyled=false,value:value}=props;const weekday=DateTime$1.toWeekday(value);const month=DateTime$1.toMonth(value);const day=DateTime$1.toDay(value);const year=DateTime$1.toYear(value);const currentYear=(new Date).getFullYear();const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_date_kit",alignment),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:unstyled?jsxs(Fragment,{children:[showIcon&&jsx("div",{children:jsx(Icon,{fixedWidth:true,icon:"calendar-alt"})}),showDayOfWeek&&jsxs(Fragment,{children:[jsx("div",{children:weekday}),jsx("div",{children:"•"})]}),jsxs("span",{children:[jsxs("span",{children:[month," ",day]}),currentYear!=year&&jsx("span",{children:`, ${year}`})]})]}):size=="md"||size=="lg"?jsxs(Title,{size:4,tag:"h4",children:[showIcon&&jsx(Body$1,{className:"pb_icon_kit_container",color:"light",tag:"span",children:jsx(Icon,{fixedWidth:true,icon:"calendar-alt"})}),showDayOfWeek&&jsxs(Fragment,{children:[weekday,jsx(Body$1,{color:"light",tag:"span",text:" • "})]}),jsxs("span",{children:[month," ",day]}),currentYear!=year&&jsx("span",{children:`, ${year}`})]}):jsxs(Fragment,{children:[showIcon&&jsx(Caption,{className:"pb_icon_kit_container",tag:"span",children:jsx(Icon,{fixedWidth:true,icon:"calendar-alt",size:"sm"})}),showDayOfWeek&&jsxs(Fragment,{children:[jsx(Caption,{tag:"div",children:weekday}),jsx(Caption,{color:"light",tag:"div",text:" • "})]}),jsxs(Caption,{tag:"span",children:[month," ",day,currentYear!=year&&jsx(Fragment,{children:`, ${year}`})]})]})})};const DatePicker=props=>{if(props.plugins);const{allowInput:allowInput=false,aria:aria={},className:className,customQuickPickDates:customQuickPickDates,dark:dark=false,data:data={},defaultDate:defaultDate="",disableDate:disableDate=null,disableInput:disableInput,disableRange:disableRange=null,disableWeekdays:disableWeekdays=null,enableTime:enableTime=false,error:error,format:format="m/d/Y",hideIcon:hideIcon=false,hideLabel:hideLabel=false,htmlOptions:htmlOptions={},id:id,inLine:inLine=false,inputAria:inputAria={},inputData:inputData={},inputOnChange:inputOnChange,inputValue:inputValue,label:label="Date Picker",maxDate:maxDate,minDate:minDate,mode:mode="single",name:name,onChange:onChange=()=>{},onClose:onClose,pickerId:pickerId,placeholder:placeholder="Select Date",plugins:plugins=false,position:position,positionElement:positionElement,scrollContainer:scrollContainer,selectionType:selectionType="",showTimezone:showTimezone=false,staticPosition:staticPosition=true,thisRangesEndToday:thisRangesEndToday=false,yearRange:yearRange=[1900,2100]}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const inputAriaProps=buildAriaProps(inputAria);const inputDataProps=buildDataProps(inputData);useEffect((()=>{datePickerHelper({allowInput:allowInput,customQuickPickDates:customQuickPickDates,defaultDate:defaultDate,disableDate:disableDate,disableRange:disableRange,disableWeekdays:disableWeekdays,enableTime:enableTime,format:format,hideIcon:hideIcon,inLine:inLine,maxDate:maxDate,minDate:minDate,mode:mode,onChange:onChange,onClose:onClose,pickerId:pickerId,plugins:plugins,position:position,positionElement:positionElement,selectionType:selectionType,showTimezone:showTimezone,staticPosition:staticPosition,thisRangesEndToday:thisRangesEndToday,yearRange:yearRange,required:false},scrollContainer)}));const filteredProps={...props};if(filteredProps.marginBottom===void 0){filteredProps.marginBottom="sm"}filteredProps==null?true:delete filteredProps.position;const classes=classnames(buildCss("pb_date_picker_kit"),globalProps(filteredProps),error?"error":null,className);const iconWrapperClass=()=>{let base="cal_icon_wrapper";if(dark){base+=" dark"}if(hideLabel){base+=" no_label_shift"}if(error){base+=" error"}return base};return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs("div",{...inputAriaProps,...inputDataProps,className:"input_wrapper",children:[jsx(Caption,{className:"pb_date_picker_kit_label",text:hideLabel?null:label}),jsxs(Fragment,{children:[jsxs("div",{className:"date_picker_input_wrapper",children:[jsx("input",{autoComplete:"off",className:"date_picker_input",disabled:disableInput,id:pickerId,name:name,onChange:inputOnChange,placeholder:placeholder,value:inputValue}),error&&jsx(Body$1,{status:"negative",text:error,variant:null})]}),!hideIcon&&jsx("div",{className:iconWrapperClass(),id:`cal-icon-${pickerId}`,children:jsx(Icon,{className:"cal_icon",icon:"calendar-alt"})}),hideIcon&&inLine?jsxs("div",{children:[jsx("div",{className:iconWrapperClass(),id:`${pickerId}-icon-plus`,children:jsx(Icon,{className:"date-picker-plus-icon",icon:"plus"})}),jsx("div",{className:iconWrapperClass(),id:`${pickerId}-angle-down`,children:jsx(Icon,{className:"angle_down_icon",icon:"angle-down"})})]}):null]})]})})};const dateTimestamp$1=(dateValue,includeYear)=>{if(includeYear){return`${DateTime$1.toMonth(dateValue)} ${DateTime$1.toDay(dateValue)}, ${DateTime$1.toYear(dateValue)}`}else{return`${DateTime$1.toMonth(dateValue)} ${DateTime$1.toDay(dateValue)}`}};const dateTimeIso$1=dateValue=>DateTime$1.toIso(dateValue);const DateRangeInline=props=>{const{align:align="left",className:className,dark:dark=false,data:data={},endDate:endDate,htmlOptions:htmlOptions={},icon:icon=false,size:size="sm",startDate:startDate}=props;const dateInCurrentYear=()=>{const currentDate=new Date;return(startDate==null?void 0:startDate.getFullYear())===(endDate==null?void 0:endDate.getFullYear())&&(startDate==null?void 0:startDate.getFullYear())===currentDate.getFullYear()};const dateRangeClasses=buildCss("pb_date_range_inline_kit",align);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const renderTime=date=>jsx("time",{dateTime:dateTimeIso$1(date),children:dateInCurrentYear()?` ${dateTimestamp$1(date,false)} `:` ${dateTimestamp$1(date,true)} `});return jsx("div",{...dataProps,...htmlProps,className:classnames(dateRangeClasses,globalProps(props),className),children:jsxs("div",{className:"pb_date_range_inline_wrapper",children:[size==="xs"&&jsxs(Fragment,{children:[icon&&jsx(Caption,{dark:dark,tag:"span",children:jsx(Icon,{className:"pb_date_range_inline_icon",dark:dark,fixedWidth:true,icon:"calendar-alt",size:size,tag:"span"})}),jsx(Caption,{dark:dark,tag:"span",children:renderTime(startDate)}),jsx(Caption,{dark:dark,tag:"span",children:jsx(Icon,{className:"pb_date_range_inline_arrow",dark:dark,fixedWidth:true,icon:"long-arrow-right",tag:"span"})}),jsx(Caption,{dark:dark,tag:"span",children:renderTime(endDate)})]}),size==="sm"&&jsxs(Fragment,{children:[icon&&jsx(Body$1,{color:"light",dark:dark,tag:"span",children:jsx(Icon,{className:"pb_date_range_inline_icon",dark:dark,fixedWidth:true,icon:"calendar-alt",size:size,tag:"span"})}),jsx(Body$1,{dark:dark,tag:"span",children:renderTime(startDate)}),jsx(Body$1,{color:"light",dark:dark,tag:"span",children:jsx(Icon,{className:"pb_date_range_inline_arrow",dark:dark,fixedWidth:true,icon:"long-arrow-right",tag:"span"})}),jsx(Body$1,{dark:dark,tag:"span",children:renderTime(endDate)})]})]})})};const DateYearStacked=props=>{const{align:align="left",className:className,dark:dark=false,date:date,data:data={},htmlOptions:htmlOptions={}}=props;const css=classnames(buildCss("pb_date_year_stacked",align),globalProps(props),className);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsxs("div",{...dataProps,...htmlProps,className:css,children:[jsx(Title,{dark:dark,size:4,text:`${DateTime$1.toDay(date)} ${DateTime$1.toMonth(date).toUpperCase()}`}),jsx(Body$1,{color:"light",children:DateTime$1.toYear(date)})]})};const DateRangeStacked=props=>{const{className:className,dark:dark=false,endDate:endDate,htmlOptions:htmlOptions={},startDate:startDate,data:data={}}=props;const css=classnames(buildCss("pb_date_range_stacked"),globalProps(props),className);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsx("div",{...dataProps,...htmlProps,className:css,children:jsxs(Flex,{vertical:"center",children:[jsx(FlexItem,{children:jsx(DateYearStacked,{align:"right",dark:dark,date:startDate})}),jsx(FlexItem,{children:jsx("div",{children:jsx(Body$1,{color:"light",tag:"span",children:jsx(Icon,{className:"pb_date_range_stacked_arrow",fixedWidth:true,icon:"long-arrow-right"})})})}),jsx(FlexItem,{children:jsx(DateYearStacked,{dark:dark,date:endDate})})]})})};const sizes={sm:4,md:3};const DateStacked=props=>{const{align:align="left",bold:bold=false,reverse:reverse=false,className:className,dark:dark=false,date:date,data:data={},htmlOptions:htmlOptions={},size:size="sm"}=props;const classes=classnames(buildCss("pb_date_stacked_kit",align,size,{dark:dark,reverse:reverse}),globalProps(props),className);const currentYear=(new Date).getFullYear();const inputYear=DateTime$1.toYear(date);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsx(Fragment,{children:bold==false?jsxs("div",{...dataProps,...htmlProps,className:classes,children:[jsxs("div",{className:"pb_date_stacked_day_month",children:[jsx(Caption,{text:DateTime$1.toMonth(date).toUpperCase()}),jsx(Title,{dark:dark,size:sizes[size],text:DateTime$1.toDay(date).toString()})]}),currentYear!=inputYear&&jsx(Caption,{size:"xs",children:inputYear})]}):jsx("div",{...dataProps,...htmlProps,className:classes,children:jsxs("div",{className:"pb_date_stacked_day_month",children:[jsx(Title,{bold:true,dark:dark,size:"4",text:DateTime$1.toMonth(date)}),jsx(Title,{bold:true,dark:dark,size:"4",text:DateTime$1.toDay(date).toString()}),currentYear!=inputYear&&jsx(Title,{size:"4",children:inputYear})]})})})};const Time=props=>{const{align:align,className:className,date:date,htmlOptions:htmlOptions={},showIcon:showIcon,size:size,timeZone:timeZone,unstyled:unstyled=false,showTimezone:showTimezone=true}=props;const classes=classnames(buildCss("pb_time_kit",align,size),globalProps(props),className);const htmlProps=buildHtmlProps(htmlOptions);return jsxs("div",{...htmlProps,className:classes,children:[showIcon&&(unstyled?jsxs("span",{children:[jsx(Icon,{fixedWidth:true,icon:"clock"})," "]}):jsx(Fragment,{children:jsxs(Body$1,{color:"light",tag:"span",children:[jsx(Icon,{fixedWidth:true,icon:"clock",size:size==="md"?"":"sm"})," "]})})),jsx("time",{dateTime:date.toLocaleString(),children:jsx("span",{children:unstyled?jsxs(Fragment,{children:[jsx("span",{children:DateTime$1.toTimeWithMeridiem(date,timeZone)})," ",showTimezone&&jsx("span",{children:DateTime$1.toTimeZone(date,timeZone)})]}):size==="md"?jsxs(Fragment,{children:[jsx(Body$1,{className:"pb_time",tag:"span",text:DateTime$1.toTimeWithMeridiem(date,timeZone)})," ",showTimezone&&jsx(Body$1,{color:"light",tag:"span",text:DateTime$1.toTimeZone(date,timeZone)})]}):jsxs(Fragment,{children:[jsx(Caption,{color:"light",tag:"span",text:DateTime$1.toTimeWithMeridiem(date,timeZone)})," ",showTimezone&&jsx(Caption,{color:"light",tag:"span",text:DateTime$1.toTimeZone(date,timeZone)})]})})})]})};const DateTime=props=>{const{align:align="left",aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},showDayOfWeek:showDayOfWeek=false,datetime:datetime2,id:id,showIcon:showIcon=false,size:size="md",timeZone:timeZone="America/New_York"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_date_time",size),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs(Flex,{horizontal:align,vertical:"baseline",children:[jsx(PbDate,{showDayOfWeek:showDayOfWeek,size:size,value:datetime2}),jsx(Time,{date:datetime2,marginLeft:"sm",showIcon:showIcon,size:size,timeZone:timeZone})]})})};const TimeStackedDefault=props=>{if(props.date);const{align:align="left",className:className,dark:dark,data:data={},date:date,htmlOptions:htmlOptions={},time:time,timeZone:timeZone}=props;const classes=classnames(buildCss("pb_time_stacked_kit",align),globalProps(props),className);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsx("div",{className:classes,...dataProps,...htmlProps,children:jsx(Body$1,{className:classnames("pb_time_stacked","time-spacing"),color:"light",dark:dark,children:jsxs("time",{children:[DateTime$1.toTimeWithMeridiem(date?date:new Date(time),timeZone),jsx(Caption,{className:"pb_time_stacked",color:"light",dark:dark,tag:"span",text:DateTime$1.toTimeZone(date?date:new Date(time),timeZone)})]})})})};const DateTimeStacked=props=>{if(props.date);const{date:date,datetime:datetime2,dark:dark,htmlOptions:htmlOptions={},timeZone:timeZone="America/New_York"}=props;const classes=buildCss("pb_date_time_stacked_kit",globalProps(props));const htmlProps=buildHtmlProps(htmlOptions);return jsxs(Flex,{inline:false,vertical:"stretch",...htmlProps,...props,children:[jsx(FlexItem,{children:jsx(DateStacked,{align:"right",bold:true,dark:dark,date:date||datetime2})}),jsx(SectionSeparator,{className:"date-time-padding",orientation:"vertical"}),jsx(FlexItem,{children:jsx(TimeStackedDefault,{className:classes,dark:dark,date:date||datetime2,timeZone:timeZone})})]})};const Detail=props=>{const{aria:aria={},bold:bold=false,children:children,className:className,color:color="light",data:data={},htmlOptions:htmlOptions={},id:id="",tag:tag="div",text:text2=""}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const isBold=bold?"bold":null;const classes=classnames(buildCss("pb_detail_kit",`color`,color),isBold,globalProps(props),className);const Tag=`${tag}`;return jsx(Tag,{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:text2||children})};const DropdownContext=createContext({});const List=props=>{const{aria:aria={},borderless:borderless=false,children:children,className:className,dark:dark=false,data:data={},enableDrag:enableDrag=false,htmlOptions:htmlOptions={},id:id,layout:layout="",ordered:ordered=false,role:role,size:size="",tabIndex:tabIndex,xpadding:xpadding=false,variant:variant,text:text2}=props;const layoutClass={left:"layout_left",right:"layout_right",default:""};const childrenWithProps=React__default.Children.map(children,(child=>React__default.cloneElement(child,{text:text2,variant:variant,enableDrag:enableDrag})));const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_list_kit",layoutClass[layout],size,{dark:dark,borderless:borderless,ordered:ordered,xpadding:xpadding}),globalProps(props),className);return jsx(Fragment,{children:enableDrag?jsx(Draggable.Container,{children:jsx("div",Object.assign({className:classes},{children:ordered?jsx("ol",Object.assign({},ariaProps,dataProps,htmlProps,{className:className,id:id,role:role,tabIndex:tabIndex},{children:childrenWithProps}),void 0):jsx("ul",Object.assign({},ariaProps,dataProps,htmlProps,{className:className,id:id,role:role,tabIndex:tabIndex},{children:childrenWithProps}),void 0)}),void 0)},void 0):jsx("div",Object.assign({className:classes},{children:ordered?jsx("ol",Object.assign({},ariaProps,dataProps,htmlProps,{className:className,id:id,role:role,tabIndex:tabIndex},{children:childrenWithProps}),void 0):jsx("ul",Object.assign({},ariaProps,dataProps,htmlProps,{className:className,id:id,role:role,tabIndex:tabIndex},{children:childrenWithProps}),void 0)}),void 0)},void 0)};const ListItem=props=>{const{aria:aria={},children:children,className:className,data:data={},enableDrag:enableDrag,dragId:dragId,dragHandle:dragHandle=true,htmlOptions:htmlOptions={},id:id,tabIndex:tabIndex}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_item_kit"),globalProps(props),className);return jsx(Fragment,{children:enableDrag?jsx(Draggable.Item,Object.assign({dragId:dragId},{children:jsxs("li",Object.assign({},ariaProps,dataProps,htmlProps,{className:classes,id:id,tabIndex:tabIndex},{children:[dragHandle&&jsx("span",Object.assign({style:{verticalAlign:"middle"}},{children:jsx(Body$1,Object.assign({color:"light"},{children:jsx(Icon,{icon:"grip-dots-vertical",verticalAlign:"middle"},void 0)}),void 0)}),void 0),children]}),void 0)}),void 0):jsx("li",Object.assign({},ariaProps,dataProps,htmlProps,{className:classes,id:id,tabIndex:tabIndex},{children:children}),void 0)},void 0)};const DropdownContainer=props=>{const{aria:aria={},children:children,className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},id:id,searchbar:searchbar=false}=props;const{dropdownContainerRef:dropdownContainerRef,filteredOptions:filteredOptions,filterItem:filterItem,handleChange:handleChange,inputRef:inputRef,isDropDownClosed:isDropDownClosed,setFocusedOptionIndex:setFocusedOptionIndex,triggerRef:triggerRef}=useContext(DropdownContext);const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_dropdown_container"),`${isDropDownClosed?"close":"open"}`,globalProps(props),className);return jsxs("div",Object.assign({},ariaProps,dataProps,htmlProps,{className:classes,id:id,onMouseEnter:()=>setFocusedOptionIndex(-1),ref:dropdownContainerRef,style:triggerRef?{}:{position:"absolute"}},{children:[searchbar&&jsx(TextInput,Object.assign({dark:dark,paddingTop:"xs",paddingX:"xs"},{children:jsx("input",{onChange:handleChange,placeholder:"Select...",ref:inputRef,value:filterItem},void 0)}),void 0),jsx(List,Object.assign({dark:dark},{children:(filteredOptions===null||filteredOptions===void 0?void 0:filteredOptions.length)===0?jsx(ListItem,Object.assign({dark:dark,display:"flex",justifyContent:"center",padding:"xs"},{children:jsx(Body$1,{color:"light",dark:dark,text:"no option"},void 0)}),void 0):children}),void 0)]}),void 0)};const DropdownOption=props=>{const{aria:aria={},children:children,className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},id:id,key:key,option:option}=props;const{filteredOptions:filteredOptions,filterItem:filterItem,focusedOptionIndex:focusedOptionIndex,handleOptionClick:handleOptionClick,selected:selected}=useContext(DropdownContext);const isItemMatchingFilter=option2=>{const label=typeof option2.label==="string"?option2.label.toLowerCase():option2.label;return String(label).toLowerCase().includes(filterItem.toLowerCase())};if(!isItemMatchingFilter(option)){return null}const isFocused=focusedOptionIndex>=0&&filteredOptions[focusedOptionIndex].label===option.label;const focusedClass=isFocused&&"focused";const selectedClass=`${selected.label===option.label?"selected":"list"}`;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_dropdown_option",selectedClass,focusedClass),globalProps(props),className);return createElement("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,key:key,onClick:()=>handleOptionClick(option)},jsx(ListItem,{cursor:"pointer",dark:dark,"data-name":option.value,padding:"none",children:children?jsx("div",{className:"dropdown_option_wrapper",children:children}):jsx(Body$1,{dark:dark,text:option.label})},option.label))};const useHandleOnKeyDown=()=>{const{autocomplete:autocomplete,filteredOptions:filteredOptions,focusedOptionIndex:focusedOptionIndex,handleBackspace:handleBackspace,handleOptionClick:handleOptionClick,selected:selected,setFocusedOptionIndex:setFocusedOptionIndex,setIsDropDownClosed:setIsDropDownClosed}=useContext(DropdownContext);return e=>{if(e.key!=="Tab"&&autocomplete&&selected&&selected.label){handleBackspace()}switch(e.key){case"Backspace":case"Delete":if(autocomplete){handleBackspace()}break;case"ArrowDown":{e.preventDefault();setIsDropDownClosed(false);const nextIndex=(focusedOptionIndex+1)%filteredOptions.length;setFocusedOptionIndex(nextIndex);break}case"ArrowUp":{e.preventDefault();const nextIndexUp=(focusedOptionIndex-1+filteredOptions.length)%filteredOptions.length;setFocusedOptionIndex(nextIndexUp);break}case"Enter":if(focusedOptionIndex!==-1){e.preventDefault();handleOptionClick(filteredOptions[focusedOptionIndex]);setFocusedOptionIndex(-1)}else if(focusedOptionIndex===-1){setIsDropDownClosed(false)}break;case"Tab":setIsDropDownClosed(true);setFocusedOptionIndex(-1);break}}};const DropdownTrigger=props=>{const{aria:aria={},children:children,className:className,customDisplay:customDisplay,dark:dark=false,data:data={},htmlOptions:htmlOptions={},id:id,placeholder:placeholder}=props;const{autocomplete:autocomplete,filterItem:filterItem,handleChange:handleChange,handleWrapperClick:handleWrapperClick,inputRef:inputRef,inputWrapperRef:inputWrapperRef,isDropDownClosed:isDropDownClosed,isInputFocused:isInputFocused,selected:selected,setIsInputFocused:setIsInputFocused,toggleDropdown:toggleDropdown,triggerRef:triggerRef}=useContext(DropdownContext);const handleKeyDown=useHandleOnKeyDown();const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_dropdown_trigger"),globalProps(props),className);const triggerWrapperClasses=buildCss("dropdown_trigger_wrapper",isInputFocused&&"focus",!autocomplete&&"select_only");const customDisplayPlaceholder=selected.label?jsx("b",{children:selected.label},void 0):autocomplete?"":placeholder?placeholder:"Select...";const defaultDisplayPlaceholder=selected.label?selected.label:autocomplete?"":placeholder?placeholder:"Select...";return jsx("div",Object.assign({},ariaProps,dataProps,htmlProps,{className:classes,id:id},{children:!triggerRef&&(children?jsx("div",Object.assign({onClick:()=>toggleDropdown(),onKeyDown:handleKeyDown,ref:inputWrapperRef,style:{display:"inline-block"},tabIndex:0},{children:children}),void 0):jsx(Fragment,{children:jsxs(Flex,Object.assign({align:"center",borderRadius:"lg",className:triggerWrapperClasses,cursor:`${autocomplete?"text":"pointer"}`,htmlOptions:{onClick:()=>handleWrapperClick(),onKeyDown:handleKeyDown,tabIndex:"0",ref:inputWrapperRef},justify:"between",paddingX:"sm",paddingY:"xs"},{children:[jsx(FlexItem,{children:jsxs(Flex,Object.assign({align:"center"},{children:[customDisplay?jsxs(Flex,Object.assign({align:"center"},{children:[customDisplay,jsx(Body$1,Object.assign({dark:dark,paddingLeft:`${selected.label?"xs":"none"}`},{children:customDisplayPlaceholder}),void 0)]}),void 0):jsx(Body$1,{dark:dark,text:defaultDisplayPlaceholder},void 0),autocomplete&&jsx("input",{className:"dropdown_input",onChange:handleChange,onClick:()=>toggleDropdown(),onFocus:()=>setIsInputFocused(true),onKeyDown:handleKeyDown,placeholder:selected.label?"":placeholder?placeholder:"Select...",ref:inputRef,value:filterItem},void 0)]}),void 0)},void 0),jsx(Body$1,Object.assign({dark:dark,display:"flex",htmlOptions:{onClick:e=>{e.stopPropagation();handleWrapperClick()}}},{children:jsx(Icon,{cursor:"pointer",dark:dark,icon:`${isDropDownClosed?"chevron-down":"chevron-up"}`,size:"sm"},void 0)}),`${isDropDownClosed?"chevron-down":"chevron-up"}`)]}),void 0)},void 0))}),void 0)};const separateChildComponents=children=>{let trigger=null;let container=null;const otherChildren=[];React__default.Children.forEach(children,(child=>{if(child&&child.type===DropdownTrigger){trigger=child}else if(child&&child.type===DropdownContainer){container=child}else{otherChildren.push(child)}}));return{trigger:trigger,container:container,otherChildren:otherChildren}};const prepareSubcomponents=({children:children,hasTriggerSubcomponent:hasTriggerSubcomponent,hasContainerSubcomponent:hasContainerSubcomponent,trigger:trigger,container:container,otherChildren:otherChildren,dark:dark})=>{const componentsToRender=[];if(!hasTriggerSubcomponent&&!hasContainerSubcomponent){componentsToRender.push(jsx(DropdownTrigger,{dark:dark},void 0));componentsToRender.push(jsx(DropdownContainer,Object.assign({dark:dark},{children:children}),void 0))}else if(!hasTriggerSubcomponent&&hasContainerSubcomponent){componentsToRender.push(jsx(DropdownTrigger,{dark:dark},void 0));componentsToRender.push(children)}else if(hasTriggerSubcomponent&&!hasContainerSubcomponent){componentsToRender.push(trigger);componentsToRender.push(jsx(DropdownContainer,Object.assign({dark:dark},{children:otherChildren}),void 0))}else{componentsToRender.push(trigger);componentsToRender.push(container)}return componentsToRender};const handleClickOutside=({inputWrapperRef:inputWrapperRef,dropdownContainerRef:dropdownContainerRef,setIsDropDownClosed:setIsDropDownClosed,setFocusedOptionIndex:setFocusedOptionIndex,setIsInputFocused:setIsInputFocused})=>e=>{let targetElement=e.target;let shouldClose=true;while(targetElement&&shouldClose){if(targetElement.getAttribute("data-dropdown")==="pb-dropdown-trigger"){shouldClose=false}targetElement=targetElement.parentElement}if(inputWrapperRef.current&&!inputWrapperRef.current.contains(e.target)&&dropdownContainerRef.current&&!dropdownContainerRef.current.contains(e.target)&&shouldClose){setIsDropDownClosed(true);setFocusedOptionIndex(-1);setIsInputFocused(false)}};const Dropdown=props=>{const{aria:aria={},autocomplete:autocomplete=false,blankSelection:blankSelection="",children:children,className:className,dark:dark=false,data:data={},defaultValue:defaultValue={},error:error,htmlOptions:htmlOptions={},id:id,isClosed:isClosed=true,label:label,onSelect:onSelect,options:options,triggerRef:triggerRef}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_dropdown"),globalProps(props),className);const[isDropDownClosed,setIsDropDownClosed,toggleDropdown]=useDropdown(isClosed);const[filterItem,setFilterItem]=useState("");const[selected,setSelected]=useState(defaultValue);const[isInputFocused,setIsInputFocused]=useState(false);const[hasTriggerSubcomponent,setHasTriggerSubcomponent]=useState(true);const[hasContainerSubcomponent,setHasContainerSubcomponent]=useState(true);const[focusedOptionIndex,setFocusedOptionIndex]=useState(-1);const dropdownRef=useRef(null);const inputRef=useRef(null);const inputWrapperRef=useRef(null);const dropdownContainerRef=useRef(null);const{trigger:trigger,container:container,otherChildren:otherChildren}=separateChildComponents(children);useEffect((()=>{if(triggerRef==null?void 0:triggerRef.current){const parentElement=triggerRef.current.parentNode;if(parentElement){parentElement.style.position="relative"}}const handleClick=handleClickOutside({inputWrapperRef:inputWrapperRef,dropdownContainerRef:dropdownContainerRef,setIsDropDownClosed:setIsDropDownClosed,setFocusedOptionIndex:setFocusedOptionIndex,setIsInputFocused:setIsInputFocused});window.addEventListener("click",handleClick);return()=>{window.removeEventListener("click",handleClick)}}),[]);useEffect((()=>{setHasTriggerSubcomponent(!!trigger);setHasContainerSubcomponent(!!container)}),[]);useEffect((()=>{setIsDropDownClosed(isClosed)}),[isClosed]);const blankSelectionOption=blankSelection?[{label:blankSelection,value:""}]:[];const optionsWithBlankSelection=blankSelectionOption.concat(options);const filteredOptions=optionsWithBlankSelection==null?void 0:optionsWithBlankSelection.filter((option=>{const label2=typeof option.label==="string"?option.label.toLowerCase():option.label;return String(label2).toLowerCase().includes(filterItem.toLowerCase())}));useEffect((()=>{if(!isDropDownClosed){let newIndex=0;if(selected&&(selected==null?void 0:selected.label)){const selectedIndex=filteredOptions.findIndex((option=>option.label===selected.label));if(selectedIndex>=0){newIndex=selectedIndex}}setFocusedOptionIndex(newIndex)}}),[isDropDownClosed]);const handleChange=e=>{setFilterItem(e.target.value);setIsDropDownClosed(false)};const handleOptionClick=selectedItem=>{setSelected(selectedItem);setFilterItem("");setIsDropDownClosed(true);onSelect&&onSelect(selectedItem)};const handleWrapperClick=()=>{autocomplete&&inputRef.current.focus();toggleDropdown()};const handleBackspace=()=>{setSelected({});onSelect&&onSelect(null);setFocusedOptionIndex(-1)};const componentsToRender=prepareSubcomponents({children:children,hasTriggerSubcomponent:hasTriggerSubcomponent,hasContainerSubcomponent:hasContainerSubcomponent,trigger:trigger,container:container,otherChildren:otherChildren,dark:dark});return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,style:triggerRef?{position:"absolute"}:{position:"relative"},children:jsxs(DropdownContext.Provider,{value:{autocomplete:autocomplete,dropdownContainerRef:dropdownContainerRef,filteredOptions:filteredOptions,filterItem:filterItem,focusedOptionIndex:focusedOptionIndex,handleBackspace:handleBackspace,handleChange:handleChange,handleOptionClick:handleOptionClick,handleWrapperClick:handleWrapperClick,inputRef:inputRef,inputWrapperRef:inputWrapperRef,isDropDownClosed:isDropDownClosed,isInputFocused:isInputFocused,optionsWithBlankSelection:optionsWithBlankSelection,selected:selected,setFocusedOptionIndex:setFocusedOptionIndex,setIsDropDownClosed:setIsDropDownClosed,setIsInputFocused:setIsInputFocused,setSelected:setSelected,toggleDropdown:toggleDropdown,triggerRef:triggerRef},children:[label&&jsx(Caption,{dark:dark,marginBottom:"xs",text:label}),jsxs("div",{className:`dropdown_wrapper ${error?"error":""}`,onBlur:()=>{setTimeout((()=>{if(!dropdownRef.current.contains(document.activeElement)){setIsInputFocused(false)}}),0)},onFocus:()=>setIsInputFocused(true),ref:dropdownRef,children:[children?jsx(Fragment,{children:componentsToRender.map(((component,index)=>jsx(React__default.Fragment,{children:component},index)))}):jsxs(Fragment,{children:[jsx(DropdownTrigger,{}),jsx(DropdownContainer,{children:optionsWithBlankSelection&&(optionsWithBlankSelection==null?void 0:optionsWithBlankSelection.map((option=>jsx(Dropdown.Option,{option:option},option.id))))})]}),error&&jsx(Body$1,{status:"negative",text:error})]})]})})};Dropdown.Option=DropdownOption;Dropdown.Trigger=DropdownTrigger;Dropdown.Container=DropdownContainer;function __awaiter(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator["throw"](value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,[])).next())}))}function __generator(thisArg,body){var _={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");while(g&&(g=0,op[0]&&(_=0)),_)try{if(f=1,y&&(t=op[0]&2?y["return"]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(op[0]===6&&_.label<t[1]){_.label=t[1];t=op;break}if(t&&_.label<t[2]){_.label=t[2];_.ops.push(op);break}if(t[2])_.ops.pop();_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e];y=0}finally{f=t=0}if(op[0]&5)throw op[1];return{value:op[0]?op[1]:void 0,done:true}}}function __read(o,n){var m=typeof Symbol==="function"&&o[Symbol.iterator];if(!m)return o;var i=m.call(o),r,ar=[],e;try{while((n===void 0||n-- >0)&&!(r=i.next()).done)ar.push(r.value)}catch(error){e={error:error}}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i)}finally{if(e)throw e.error}}return ar}function __spread(){for(var ar=[],i=0;i<arguments.length;i++)ar=ar.concat(__read(arguments[i]));return ar}var COMMON_MIME_TYPES=new Map([["avi","video/avi"],["gif","image/gif"],["ico","image/x-icon"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["mkv","video/x-matroska"],["mov","video/quicktime"],["mp4","video/mp4"],["pdf","application/pdf"],["png","image/png"],["zip","application/zip"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]]);function toFileWithPath(file,path){var f=withMimeType(file);if(typeof f.path!=="string"){var webkitRelativePath=file.webkitRelativePath;Object.defineProperty(f,"path",{value:typeof path==="string"?path:typeof webkitRelativePath==="string"&&webkitRelativePath.length>0?webkitRelativePath:file.name,writable:false,configurable:false,enumerable:true})}return f}function withMimeType(file){var name=file.name;var hasExtension=name&&name.lastIndexOf(".")!==-1;if(hasExtension&&!file.type){var ext=name.split(".").pop().toLowerCase();var type=COMMON_MIME_TYPES.get(ext);if(type){Object.defineProperty(file,"type",{value:type,writable:false,configurable:false,enumerable:true})}}return file}var FILES_TO_IGNORE=[".DS_Store","Thumbs.db"];function fromEvent(evt){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(_a){return[2,isDragEvt(evt)&&evt.dataTransfer?getDataTransferFiles(evt.dataTransfer,evt.type):getInputFiles(evt)]}))}))}function isDragEvt(value){return!!value.dataTransfer}function getInputFiles(evt){var files=isInput(evt.target)?evt.target.files?fromList(evt.target.files):[]:[];return files.map((function(file){return toFileWithPath(file)}))}function isInput(value){return value!==null}function getDataTransferFiles(dt,type){return __awaiter(this,void 0,void 0,(function(){var items,files;return __generator(this,(function(_a){switch(_a.label){case 0:if(!dt.items)return[3,2];items=fromList(dt.items).filter((function(item){return item.kind==="file"}));if(type!=="drop"){return[2,items]}return[4,Promise.all(items.map(toFilePromises))];case 1:files=_a.sent();return[2,noIgnoredFiles(flatten(files))];case 2:return[2,noIgnoredFiles(fromList(dt.files).map((function(file){return toFileWithPath(file)})))]}}))}))}function noIgnoredFiles(files){return files.filter((function(file){return FILES_TO_IGNORE.indexOf(file.name)===-1}))}function fromList(items){var files=[];for(var i=0;i<items.length;i++){var file=items[i];files.push(file)}return files}function toFilePromises(item){if(typeof item.webkitGetAsEntry!=="function"){return fromDataTransferItem(item)}var entry=item.webkitGetAsEntry();if(entry&&entry.isDirectory){return fromDirEntry(entry)}return fromDataTransferItem(item)}function flatten(items){return items.reduce((function(acc,files){return __spread(acc,Array.isArray(files)?flatten(files):[files])}),[])}function fromDataTransferItem(item){var file=item.getAsFile();if(!file){return Promise.reject(item+" is not a File")}var fwp=toFileWithPath(file);return Promise.resolve(fwp)}function fromEntry(entry){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(_a){return[2,entry.isDirectory?fromDirEntry(entry):fromFileEntry(entry)]}))}))}function fromDirEntry(entry){var reader=entry.createReader();return new Promise((function(resolve,reject){var entries=[];function readEntries(){var _this=this;reader.readEntries((function(batch){return __awaiter(_this,void 0,void 0,(function(){var files,err_1,items;return __generator(this,(function(_a){switch(_a.label){case 0:if(!!batch.length)return[3,5];_a.label=1;case 1:_a.trys.push([1,3,,4]);return[4,Promise.all(entries)];case 2:files=_a.sent();resolve(files);return[3,4];case 3:err_1=_a.sent();reject(err_1);return[3,4];case 4:return[3,6];case 5:items=Promise.all(batch.map(fromEntry));entries.push(items);readEntries();_a.label=6;case 6:return[2]}}))}))}),(function(err){reject(err)}))}readEntries()}))}function fromFileEntry(entry){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(_a){return[2,new Promise((function(resolve,reject){entry.file((function(file){var fwp=toFileWithPath(file,entry.fullPath);resolve(fwp)}),(function(err){reject(err)}))}))]}))}))}var _default$1=function(file,acceptedFiles){if(file&&acceptedFiles){var acceptedFilesArray=Array.isArray(acceptedFiles)?acceptedFiles:acceptedFiles.split(",");var fileName=file.name||"";var mimeType=(file.type||"").toLowerCase();var baseMimeType=mimeType.replace(/\/.*$/,"");return acceptedFilesArray.some((function(type){var validType=type.trim().toLowerCase();if(validType.charAt(0)==="."){return fileName.toLowerCase().endsWith(validType)}else if(validType.endsWith("/*")){return baseMimeType===validType.replace(/\/.*$/,"")}return mimeType===validType}))}return true};function fileAccepted(file,accept){return file.type==="application/x-moz-file"||_default$1(file,accept)}function fileMatchSize(file,minSize,maxSize){if(isDefined(file.size)){if(isDefined(minSize)&&isDefined(maxSize))return file.size>=minSize&&file.size<=maxSize;else if(isDefined(minSize))return file.size>=minSize;else if(isDefined(maxSize))return file.size<=maxSize}return true}function isDefined(value){return value!==void 0&&value!==null}function allFilesAccepted(_ref){var files=_ref.files,accept=_ref.accept,minSize=_ref.minSize,maxSize=_ref.maxSize,multiple=_ref.multiple;if(!multiple&&files.length>1){return false}return files.every((function(file){return fileAccepted(file,accept)&&fileMatchSize(file,minSize,maxSize)}))}function isPropagationStopped(event){if(typeof event.isPropagationStopped==="function"){return event.isPropagationStopped()}else if(typeof event.cancelBubble!=="undefined"){return event.cancelBubble}return false}function isEvtWithFiles(event){if(!event.dataTransfer){return!!event.target&&!!event.target.files}return Array.prototype.some.call(event.dataTransfer.types,(function(type){return type==="Files"||type==="application/x-moz-file"}))}function onDocumentDragOver(event){event.preventDefault()}function isIe(userAgent){return userAgent.indexOf("MSIE")!==-1||userAgent.indexOf("Trident/")!==-1}function isEdge(userAgent){return userAgent.indexOf("Edge/")!==-1}function isIeOrEdge(){var userAgent=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return isIe(userAgent)||isEdge(userAgent)}function composeEventHandlers(){for(var _len=arguments.length,fns=new Array(_len),_key=0;_key<_len;_key++){fns[_key]=arguments[_key]}return function(event){for(var _len2=arguments.length,args=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){args[_key2-1]=arguments[_key2]}return fns.some((function(fn){if(!isPropagationStopped(event)&&fn){fn.apply(void 0,[event].concat(args))}return isPropagationStopped(event)}))}}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||Object.prototype.toString.call(iter)==="[object Arguments]")return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i<arr.length;i++){arr2[i]=arr[i]}return arr2}}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function _iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||Object.prototype.toString.call(arr)==="[object Arguments]")){return}var _arr=[];var _n=true;var _d=false;var _e=void 0;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function ownKeys$2(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}));keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys$2(source,true).forEach((function(key){_defineProperty$2(target,key,source[key])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys$2(source).forEach((function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}))}}return target}function _defineProperty$2(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _objectWithoutProperties$2(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose$2(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose$2(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key]}return target}var Dropzone=forwardRef((function(_ref,ref){var children=_ref.children,params=_objectWithoutProperties$2(_ref,["children"]);var _useDropzone=useDropzone(params),open=_useDropzone.open,props=_objectWithoutProperties$2(_useDropzone,["open"]);useImperativeHandle(ref,(function(){return{open:open}}),[open]);return React__default.createElement(Fragment$1,null,children(_objectSpread({},props,{open:open})))}));Dropzone.displayName="Dropzone";Dropzone.propTypes={children:PropTypes.func,accept:PropTypes.oneOfType([PropTypes.string,PropTypes.arrayOf(PropTypes.string)]),multiple:PropTypes.bool,preventDropOnDocument:PropTypes.bool,noClick:PropTypes.bool,noKeyboard:PropTypes.bool,noDrag:PropTypes.bool,noDragEventsBubbling:PropTypes.bool,minSize:PropTypes.number,maxSize:PropTypes.number,disabled:PropTypes.bool,getFilesFromEvent:PropTypes.func,onFileDialogCancel:PropTypes.func,onDragEnter:PropTypes.func,onDragLeave:PropTypes.func,onDragOver:PropTypes.func,onDrop:PropTypes.func,onDropAccepted:PropTypes.func,onDropRejected:PropTypes.func};var initialState$1={isFocused:false,isFileDialogActive:false,isDragActive:false,isDragAccept:false,isDragReject:false,draggedFiles:[],acceptedFiles:[],rejectedFiles:[]};function useDropzone(){var _ref2=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},accept=_ref2.accept,_ref2$disabled=_ref2.disabled,disabled=_ref2$disabled===void 0?false:_ref2$disabled,_ref2$getFilesFromEve=_ref2.getFilesFromEvent,getFilesFromEvent=_ref2$getFilesFromEve===void 0?fromEvent:_ref2$getFilesFromEve,_ref2$maxSize=_ref2.maxSize,maxSize=_ref2$maxSize===void 0?Infinity:_ref2$maxSize,_ref2$minSize=_ref2.minSize,minSize=_ref2$minSize===void 0?0:_ref2$minSize,_ref2$multiple=_ref2.multiple,multiple=_ref2$multiple===void 0?true:_ref2$multiple,onDragEnter=_ref2.onDragEnter,onDragLeave=_ref2.onDragLeave,onDragOver=_ref2.onDragOver,onDrop=_ref2.onDrop,onDropAccepted=_ref2.onDropAccepted,onDropRejected=_ref2.onDropRejected,onFileDialogCancel=_ref2.onFileDialogCancel,_ref2$preventDropOnDo=_ref2.preventDropOnDocument,preventDropOnDocument=_ref2$preventDropOnDo===void 0?true:_ref2$preventDropOnDo,_ref2$noClick=_ref2.noClick,noClick=_ref2$noClick===void 0?false:_ref2$noClick,_ref2$noKeyboard=_ref2.noKeyboard,noKeyboard=_ref2$noKeyboard===void 0?false:_ref2$noKeyboard,_ref2$noDrag=_ref2.noDrag,noDrag=_ref2$noDrag===void 0?false:_ref2$noDrag,_ref2$noDragEventsBub=_ref2.noDragEventsBubbling,noDragEventsBubbling=_ref2$noDragEventsBub===void 0?false:_ref2$noDragEventsBub;var rootRef=useRef(null);var inputRef=useRef(null);var _useReducer=useReducer(reducer,initialState$1),_useReducer2=_slicedToArray(_useReducer,2),state=_useReducer2[0],dispatch=_useReducer2[1];var isFocused=state.isFocused,isFileDialogActive=state.isFileDialogActive,draggedFiles=state.draggedFiles;var openFileDialog=useCallback((function(){if(inputRef.current){dispatch({type:"openDialog"});inputRef.current.value=null;inputRef.current.click()}}),[dispatch]);var onWindowFocus=function onWindowFocus2(){if(isFileDialogActive){setTimeout((function(){if(inputRef.current){var files=inputRef.current.files;if(!files.length){dispatch({type:"closeDialog"});if(typeof onFileDialogCancel==="function"){onFileDialogCancel()}}}}),300)}};useEffect((function(){window.addEventListener("focus",onWindowFocus,false);return function(){window.removeEventListener("focus",onWindowFocus,false)}}),[inputRef,isFileDialogActive,onFileDialogCancel]);var onKeyDownCb=useCallback((function(event){if(!rootRef.current||!rootRef.current.isEqualNode(event.target)){return}if(event.keyCode===32||event.keyCode===13){event.preventDefault();openFileDialog()}}),[rootRef,inputRef]);var onFocusCb=useCallback((function(){dispatch({type:"focus"})}),[]);var onBlurCb=useCallback((function(){dispatch({type:"blur"})}),[]);var onClickCb=useCallback((function(){if(noClick){return}if(isIeOrEdge()){setTimeout(openFileDialog,0)}else{openFileDialog()}}),[inputRef,noClick]);var dragTargetsRef=useRef([]);var onDocumentDrop=function onDocumentDrop2(event){if(rootRef.current&&rootRef.current.contains(event.target)){return}event.preventDefault();dragTargetsRef.current=[]};useEffect((function(){if(preventDropOnDocument){document.addEventListener("dragover",onDocumentDragOver,false);document.addEventListener("drop",onDocumentDrop,false)}return function(){if(preventDropOnDocument){document.removeEventListener("dragover",onDocumentDragOver);document.removeEventListener("drop",onDocumentDrop)}}}),[rootRef,preventDropOnDocument]);var onDragEnterCb=useCallback((function(event){event.preventDefault();event.persist();stopPropagation(event);if(dragTargetsRef.current.indexOf(event.target)===-1){dragTargetsRef.current=[].concat(_toConsumableArray(dragTargetsRef.current),[event.target])}if(isEvtWithFiles(event)){Promise.resolve(getFilesFromEvent(event)).then((function(draggedFiles2){if(isPropagationStopped(event)&&!noDragEventsBubbling){return}dispatch({draggedFiles:draggedFiles2,isDragActive:true,type:"setDraggedFiles"});if(onDragEnter){onDragEnter(event)}}))}}),[getFilesFromEvent,onDragEnter,noDragEventsBubbling]);var onDragOverCb=useCallback((function(event){event.preventDefault();event.persist();stopPropagation(event);if(event.dataTransfer){try{event.dataTransfer.dropEffect="copy"}catch(_unused){}}if(isEvtWithFiles(event)&&onDragOver){onDragOver(event)}return false}),[onDragOver,noDragEventsBubbling]);var onDragLeaveCb=useCallback((function(event){event.preventDefault();event.persist();stopPropagation(event);var targets=dragTargetsRef.current.filter((function(target){return target!==event.target&&rootRef.current&&rootRef.current.contains(target)}));dragTargetsRef.current=targets;if(targets.length>0){return}dispatch({isDragActive:false,type:"setDraggedFiles",draggedFiles:[]});if(isEvtWithFiles(event)&&onDragLeave){onDragLeave(event)}}),[rootRef,onDragLeave,noDragEventsBubbling]);var onDropCb=useCallback((function(event){event.preventDefault();event.persist();stopPropagation(event);dragTargetsRef.current=[];if(isEvtWithFiles(event)){Promise.resolve(getFilesFromEvent(event)).then((function(files){if(isPropagationStopped(event)&&!noDragEventsBubbling){return}var acceptedFiles=[];var rejectedFiles=[];files.forEach((function(file){if(fileAccepted(file,accept)&&fileMatchSize(file,minSize,maxSize)){acceptedFiles.push(file)}else{rejectedFiles.push(file)}}));if(!multiple&&acceptedFiles.length>1){rejectedFiles.push.apply(rejectedFiles,_toConsumableArray(acceptedFiles.splice(0)))}dispatch({acceptedFiles:acceptedFiles,rejectedFiles:rejectedFiles,type:"setFiles"});if(onDrop){onDrop(acceptedFiles,rejectedFiles,event)}if(rejectedFiles.length>0&&onDropRejected){onDropRejected(rejectedFiles,event)}if(acceptedFiles.length>0&&onDropAccepted){onDropAccepted(acceptedFiles,event)}}))}dispatch({type:"reset"})}),[multiple,accept,minSize,maxSize,getFilesFromEvent,onDrop,onDropAccepted,onDropRejected,noDragEventsBubbling]);var composeHandler=function composeHandler2(fn){return disabled?null:fn};var composeKeyboardHandler=function composeKeyboardHandler2(fn){return noKeyboard?null:composeHandler(fn)};var composeDragHandler=function composeDragHandler2(fn){return noDrag?null:composeHandler(fn)};var stopPropagation=function stopPropagation2(event){if(noDragEventsBubbling){event.stopPropagation()}};var getRootProps=useMemo((function(){return function(){var _ref3=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},_ref3$refKey=_ref3.refKey,refKey=_ref3$refKey===void 0?"ref":_ref3$refKey,onKeyDown=_ref3.onKeyDown,onFocus=_ref3.onFocus,onBlur=_ref3.onBlur,onClick=_ref3.onClick,onDragEnter2=_ref3.onDragEnter,onDragOver2=_ref3.onDragOver,onDragLeave2=_ref3.onDragLeave,onDrop2=_ref3.onDrop,rest=_objectWithoutProperties$2(_ref3,["refKey","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return _objectSpread(_defineProperty$2({onKeyDown:composeKeyboardHandler(composeEventHandlers(onKeyDown,onKeyDownCb)),onFocus:composeKeyboardHandler(composeEventHandlers(onFocus,onFocusCb)),onBlur:composeKeyboardHandler(composeEventHandlers(onBlur,onBlurCb)),onClick:composeHandler(composeEventHandlers(onClick,onClickCb)),onDragEnter:composeDragHandler(composeEventHandlers(onDragEnter2,onDragEnterCb)),onDragOver:composeDragHandler(composeEventHandlers(onDragOver2,onDragOverCb)),onDragLeave:composeDragHandler(composeEventHandlers(onDragLeave2,onDragLeaveCb)),onDrop:composeDragHandler(composeEventHandlers(onDrop2,onDropCb))},refKey,rootRef),!disabled&&!noKeyboard?{tabIndex:0}:{},{},rest)}}),[rootRef,onKeyDownCb,onFocusCb,onBlurCb,onClickCb,onDragEnterCb,onDragOverCb,onDragLeaveCb,onDropCb,noKeyboard,noDrag,disabled]);var onInputElementClick=useCallback((function(event){event.stopPropagation()}),[]);var getInputProps=useMemo((function(){return function(){var _ref4=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},_ref4$refKey=_ref4.refKey,refKey=_ref4$refKey===void 0?"ref":_ref4$refKey,onChange=_ref4.onChange,onClick=_ref4.onClick,rest=_objectWithoutProperties$2(_ref4,["refKey","onChange","onClick"]);var inputProps=_defineProperty$2({accept:accept,multiple:multiple,type:"file",style:{display:"none"},onChange:composeHandler(composeEventHandlers(onChange,onDropCb)),onClick:composeHandler(composeEventHandlers(onClick,onInputElementClick)),autoComplete:"off",tabIndex:-1},refKey,inputRef);return _objectSpread({},inputProps,{},rest)}}),[inputRef,accept,multiple,onDropCb,disabled]);var fileCount=draggedFiles.length;var isDragAccept=fileCount>0&&allFilesAccepted({files:draggedFiles,accept:accept,minSize:minSize,maxSize:maxSize,multiple:multiple});var isDragReject=fileCount>0&&!isDragAccept;return _objectSpread({},state,{isDragAccept:isDragAccept,isDragReject:isDragReject,isFocused:isFocused&&!disabled,getRootProps:getRootProps,getInputProps:getInputProps,rootRef:rootRef,inputRef:inputRef,open:composeHandler(openFileDialog)})}function reducer(state,action){switch(action.type){case"focus":return _objectSpread({},state,{isFocused:true});case"blur":return _objectSpread({},state,{isFocused:false});case"openDialog":return _objectSpread({},state,{isFileDialogActive:true});case"closeDialog":return _objectSpread({},state,{isFileDialogActive:false});case"setDraggedFiles":var isDragActive=action.isDragActive,draggedFiles=action.draggedFiles;return _objectSpread({},state,{draggedFiles:draggedFiles,isDragActive:isDragActive});case"setFiles":return _objectSpread({},state,{acceptedFiles:action.acceptedFiles,rejectedFiles:action.rejectedFiles});case"reset":return _objectSpread({},state,{isFileDialogActive:false,isDragActive:false,draggedFiles:[],acceptedFiles:[],rejectedFiles:[]});default:return state}}const getFormattedFileSize=fileSize=>`${fileSize/1e6} MB`;const FileUpload=props=>{const{accept:accept=null,acceptedFilesDescription:acceptedFilesDescription="",className:className,customMessage:customMessage,data:data={},htmlOptions:htmlOptions={},maxSize:maxSize,onFilesAccepted:onFilesAccepted=noop$2,onFilesRejected:onFilesRejected=noop$2}=props;const onDrop=useCallback((files=>{onFilesAccepted(files)}),[onFilesAccepted]);const{getRootProps:getRootProps,getInputProps:getInputProps,isDragActive:isDragActive,rejectedFiles:rejectedFiles}=useDropzone({accept:accept,maxSize:maxSize,onDrop:onDrop});const prevRejected=useRef(null);const maxFileSizeText=`Max file size is ${getFormattedFileSize(maxSize)}.`;useEffect((()=>{if(rejectedFiles===prevRejected.current)return;const isFileTooLarge=maxSize&&rejectedFiles.length>0&&rejectedFiles[0].size>maxSize;if(isFileTooLarge){onFilesRejected(`File size is too large! ${maxFileSizeText}`,rejectedFiles)}prevRejected.current=rejectedFiles}),[maxFileSizeText,maxSize,onFilesRejected,rejectedFiles]);const acceptedFileTypes=()=>accept.map((fileType=>{if(fileType.startsWith("image/")){return fileType.replace("image/"," ")}else{return fileType}}));const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const getDescription=()=>customMessage?customMessage:`Choose a file or drag it here.${accept===null?"":` The accepted file types are: ${acceptedFilesDescription||acceptedFileTypes()}.`}${maxSize?` ${maxFileSizeText}`:""}`;return jsx("div",{className:classnames(buildCss("pb_file_upload_kit"),globalProps(props),className),...dataProps,...htmlProps,...getRootProps(),children:jsxs(Card,{children:[jsx("input",{...getInputProps()}),jsx(Body$1,{color:"light",children:isDragActive?jsx("p",{children:"Drop the files here ..."}):jsx("p",{children:getDescription()})})]})})};const hiddenFilters=value=>isEmpty(value)&&value!==true;const CurrentFilters=({dark:dark,filters:filters})=>{const displayableFilters=omitBy(filters,hiddenFilters);return jsxs("div",{className:"maskContainer",children:[isEmpty(filters)&&jsx("div",{className:"filters",children:jsx(Body$1,{color:"light",paddingLeft:"xs",size:4,tag:"span",text:"No Filter Selected"})}),!isEmpty(filters)&&jsxs("div",{className:"filters",children:[jsx("div",{className:"left_gradient"}),map(displayableFilters,((value,name)=>jsx("div",{className:"filter",children:value===true?jsx(Title,{dark:dark,size:4,tag:"h4",text:name}):jsxs("div",{children:[jsx(Caption,{dark:dark,text:name}),jsx(Title,{dark:dark,size:4,tag:"h4",text:value})]})},`filter-${name}`))),jsx("div",{className:"right_gradient"})]})]})};const FilterBackground=props=>{const{background:background=true,className:className,children:children,dark:dark}=props;return jsx("div",{className:classnames(`pb_filter_kit ${className}`,globalProps(props)),children:background?jsx(Card,{dark:dark,padding:"none",children:children}):jsx(Fragment,{children:children})})};const FiltersPopover=({children:children,dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement="bottom-start"})=>{const[hide2,updateHide]=useState(true);const toggle=()=>updateHide(!hide2);const filterButton=jsx(CircleIconButton,{dark:dark,icon:"filter",id:"filter",onClick:toggle,variant:"secondary"});return jsx(PbReactPopover,{closeOnClick:"outside",maxHeight:maxHeight,minWidth:minWidth,placement:placement,reference:filterButton,shouldClosePopover:updateHide,show:!hide2,children:jsx("div",{className:"pb-form",children:typeof children==="function"?children({closePopover:()=>updateHide(true)}):children})})};const TitleCount=props=>{const{align:align="left",aria:aria={},className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},count:count2,id:id,title:title,size:size="sm"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const css=classnames(buildCss("pb_title_count_kit",align,size),globalProps(props),className);const formatCount=count2.toLocaleString();return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:css,id:id,children:[jsx(Title,{className:title!==void 0?"pb_title_count_text":"",dark:dark,size:size==="lg"?3:4,text:title}),jsx(Body$1,{color:"light",dark:dark,children:count2&&formatCount})]})};const resultsText=results=>results==1?"Result":"Results";const ResultsCount=({dark:dark,results:results,title:title})=>{const resultTitle=()=>jsx(TitleCount,{align:"center",count:results,dark:dark,title:`${resultsText(results)}:`});const justResults=()=>jsx(Caption,{className:"filter-results",dark:dark,size:"xs",text:`${results} ${resultsText(results)}`});const displayResultsCount=()=>{if(results&&title){return jsx(Fragment,{children:resultTitle()})}else if(results){return jsx(Fragment,{children:justResults()})}else{return jsx("div",{})}};return jsx(Fragment,{children:displayResultsCount()})};const nextValue=(value,name)=>{const current=find$1(value,{name:name});return{name:name,dir:current&¤t.dir=="asc"?"desc":"asc"}};const directionIcon=dir=>dir=="asc"?"sort-amount-up":"sort-amount-down";const renderOptions=(options,value,handleChange)=>map(options,((label,name)=>{const next=nextValue(value,name);return jsx(ListItem,{children:jsx(Button,{htmlType:void 0,onClick:partial(handleChange,next),text:` ${label}`,variant:"link"})},`option-${next.name}-${next.dir}`)}));const SortMenu=({dark:dark,options:options,value:value,onChange:onChange})=>{const[hide2,updateHide]=useState(true);const toggle=()=>updateHide(!hide2);const handleChange=value2=>{updateHide(true);onChange([value2])};const sortButton=jsx(Button,{dark:dark,htmlType:void 0,id:"sort-button",onClick:toggle,paddingRight:"none",variant:"link",children:map(value,(({dir:dir,name:name})=>jsxs("span",{children:[` ${options[name]}`,jsx(Icon,{dark:dark,icon:directionIcon(dir)})]},`current-sort-${name}-${dir}`)))});return jsx(PbReactPopover,{className:"pb_filter_sort_menu",closeOnClick:"outside",padding:"none",placement:"bottom",reference:sortButton,shouldClosePopover:updateHide,show:!hide2,children:jsx(List,{children:renderOptions(options,value,handleChange)})})};const FilterSingle=({onSortChange:onSortChange,sortOptions:sortOptions,sortValue:sortValue,filters:filters,results:results,children:children,dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement,...bgProps})=>jsx(FilterBackground,{dark:dark,...bgProps,children:jsxs(Flex,{orientation:"row",paddingRight:"lg",vertical:"center",children:[children&&jsxs(Fragment,{children:[jsx(FiltersPopover,{dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement,children:children}),jsx(CurrentFilters,{dark:dark,filters:filters})]}),jsx(ResultsCount,{dark:dark,results:results}),!isEmpty(sortOptions)&&jsx(SortMenu,{dark:dark,onChange:onSortChange,options:sortOptions,value:sortValue})]})});const FilterDouble=({onSortChange:onSortChange,sortOptions:sortOptions,sortValue:sortValue,filters:filters,results:results,children:children,dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement,...bgProps})=>jsxs(FilterBackground,{dark:dark,...bgProps,children:[jsxs(Flex,{orientation:"row",vertical:"center",children:[jsx(FiltersPopover,{dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement,children:children}),jsx(CurrentFilters,{dark:dark,filters:filters})]}),jsx(SectionSeparator,{dark:dark}),jsxs(Flex,{className:"filter-bottom",orientation:"row",spacing:"between",vertical:"center",children:[jsx(ResultsCount,{dark:dark,results:results,title:true}),jsxs(Flex,{orientation:"row",vertical:"center",children:[jsx(Caption,{dark:dark,text:"sort by:"}),jsx(SortMenu,{dark:dark,onChange:onSortChange,options:sortOptions,value:sortValue})]})]})]});const Filter=({double:double=false,...templateProps})=>{const displayFilter=()=>{if(double===true){return jsx(FilterDouble,{...templateProps})}else{return jsx(FilterSingle,{...templateProps})}};return jsx(Fragment,{children:displayFilter()})};const iconMap={success:"check",error:"exclamation-triangle",neutral:"info-circle",tip:"info-circle"};const FixedConfirmationToast=props=>{const[showToast,toggleToast]=useState(true);const{autoClose:autoClose=0,children:children,className:className,closeable:closeable=false,horizontal:horizontal,htmlOptions:htmlOptions={},icon:icon,multiLine:multiLine=false,onClose:onClose=()=>void 0,open:open=true,status:status="neutral",text:text2,vertical:vertical}=props;const returnedIcon=icon||iconMap[status];const iconClass=icon?"custom_icon":"";const css=classnames(`pb_fixed_confirmation_toast_kit_${status}`,{_multi_line:multiLine},{[`positioned_toast ${vertical} ${horizontal}`]:vertical&&horizontal},`${iconClass}`,globalProps(props),className);const htmlProps=buildHtmlProps(htmlOptions);const autoCloseToast=()=>{if(autoClose&&open){setTimeout((()=>{toggleToast(false);onClose()}),autoClose)}};useEffect((()=>{toggleToast(open);autoCloseToast()}),[open]);const handleClick=()=>{toggleToast(!closeable);onClose()};return jsx(Fragment,{children:showToast&&jsxs("div",{className:css,onClick:handleClick,...htmlProps,children:[returnedIcon&&jsx(Icon,{className:"pb_icon",fixedWidth:true,icon:returnedIcon}),children&&children||text2&&jsx(Title,{className:"pb_fixed_confirmation_toast_text",flex:"1",size:4,text:text2}),closeable&&jsx(Icon,{className:"pb_icon",cursor:"pointer",fixedWidth:false,icon:"times"})]})})};const FormGroup=props=>{const{aria:aria={},className:className,data:data={},fullWidth:fullWidth=false,htmlOptions:htmlOptions={},id:id,children:children}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_form_group_kit",{full:fullWidth}),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children})};const typeMap={home:"H#",project:"P#",appointment:"A#",default:"#"};const Hashtag=props=>{const{aria:aria={},className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},id:id,newWindow:newWindow,rel:rel,text:text2,type:type="default",url:url}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_hashtag_kit"),globalProps(props),className);return jsx("span",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsx("a",{href:url,rel:newWindow?"noreferrer":rel,target:newWindow?"_blank":"_self",children:jsx(Badge,{dark:dark,text:typeMap[type]+text2,variant:"primary"})})})};const HomeAddressStreet=props=>{const{address:address,addressCont:addressCont,aria:aria={},city:city,className:className,data:data={},dark:dark=false,emphasis:emphasis="street",htmlOptions:htmlOptions={},homeId:homeId,homeUrl:homeUrl,newWindow:newWindow,houseStyle:houseStyle,state:state,zipcode:zipcode,territory:territory}=props;const classes=(className2,dark2)=>classnames({pb_home_address_street:!dark2,pb_home_address_street_dark:dark2},globalProps(props),className2);const dataProps=buildDataProps(data);const ariaProps=buildAriaProps(aria);const htmlProps=buildHtmlProps(htmlOptions);return jsxs("div",{className:classes(className,dark),...ariaProps,...dataProps,...htmlProps,children:[emphasis=="street"&&jsxs("div",{children:[jsx(Title,{className:"pb_home_address_street_address",dark:dark,size:4,children:joinPresent([titleize(address),houseStyle]," · ")}),jsx(Title,{className:"pb_home_address_street_address",dark:dark,size:4,children:titleize(addressCont)}),jsx(Body$1,{color:"light",children:`${titleize(city)}, ${state} ${zipcode}`})]}),emphasis=="city"&&jsxs("div",{children:[jsx(Body$1,{color:"light",children:joinPresent([titleize(address),houseStyle]," · ")}),jsx(Body$1,{color:"light",children:titleize(addressCont)}),jsxs("div",{children:[jsx(Title,{className:"pb_home_address_street_address",dark:dark,size:4,tag:"span",children:`${titleize(city)}, ${state}`}),jsx(Body$1,{color:"light",tag:"span",children:` ${zipcode}`})]})]}),homeId&&jsx(Hashtag,{classname:"home-hashtag",dark:dark,marginRight:"xxs",newWindow:newWindow,text:homeId,type:"home",url:homeUrl||"#"}),jsx(Body$1,{color:"light",tag:"span",children:jsx("small",{children:territory})})]})};const IconStatValue=props=>{const{aria:aria={},className:className,data:data={},dark:dark=false,htmlOptions:htmlOptions={},icon:icon,id:id,orientation:orientation="horizontal",size:size="sm",text:text2="",unit:unit="",value:value=0,variant:variant="default"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_icon_stat_value_kit",orientation,size,variant),globalProps(props),className);const titleSize=function(size2){if(size2=="lg"){return jsx(Title,{dark:dark,size:1,tag:"span",text:`${value}`})}else if(size2=="md"){return jsx(Title,{dark:dark,size:2,tag:"span",text:`${value}`})}else{return jsx(Title,{dark:dark,size:3,tag:"span",text:`${value}`})}};return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[jsx(IconCircle,{dark:dark,icon:icon,size:size,variant:variant}),jsxs("div",{children:[jsxs(Flex,{align:"baseline",children:[titleSize(size)," ",jsx(Body$1,{dark:dark,text:unit})]}),jsx(Caption,{dark:dark,text:text2})]})]})};const IconValue=props=>{const{align:align="left",aria:aria={},className:className,dark:dark,data:data={},htmlOptions:htmlOptions={},icon:icon,id:id,text:text2}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_icon_value_kit",align),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs(Body$1,{color:"light",dark:dark,children:[jsx(Icon,{dark:dark,fixedWidth:true,icon:icon}),text2]})})};const Pill=props=>{const{aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,text:text2,variant:variant="neutral",textTransform:textTransform="lowercase"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_pill_kit",variant,textTransform),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsx(Title,{className:"pb_pill_text",size:4,tag:"div",text:text2})})};const LabelPill=props=>{const{aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,label:label,pillValue:pillValue,variant:variant="neutral"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const css=classnames("pb_label_pill_kit",globalProps(props),className);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:css,id:id,children:[jsx(Caption,{className:"pb_label_pill_label",text:label}),jsx(Pill,{className:"pb_label_pill_pill",text:pillValue,variant:variant})]})};const dateString=value=>{const month=DateTime$1.toMonthNum(value);const day=DateTime$1.toDay(value);return` · ${month}/${day}`};const LabelValue=props=>{const{active:active=false,aria:aria={},className:className,dark:dark=false,data:data={},date:date,description:description,htmlOptions:htmlOptions={},icon:icon,id:id,label:label,title:title,value:value,variant:variant="default"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const variantClass=variant==="details"?"details":"";const classes=classnames(buildCss("pb_label_value_kit",variantClass),globalProps(props),className);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,title:title,children:[jsx(Caption,{dark:dark,text:label}),variant==="details"?jsxs(Flex,{inline:true,vertical:"center",children:[icon&&jsx(Body$1,{color:"light",dark:dark,marginRight:"xs",children:jsx(Icon,{dark:dark,fixedWidth:true,icon:icon})}),description&&jsx(Body$1,{color:"light",dark:dark,marginRight:"xs",text:description}),active===true?jsxs(Flex,{inline:true,vertical:"center",children:[title&&jsx(Title,{dark:dark,size:4,text:title,variant:"link"}),date&&jsx(Title,{dark:dark,marginLeft:"xs",size:4,text:" "+dateString(date),variant:"link"})]}):jsxs(Fragment,{children:[title&&jsx(Title,{dark:dark,size:4,text:title}),date&&jsx(Title,{dark:dark,marginLeft:"xs",size:4,text:" "+dateString(date)})]})]}):jsx(Body$1,{dark:dark,text:value})]})};const Side=props=>{const{children:children,className:className}=props;return jsx("div",{className:classnames("layout_sidebar",globalProps(props),className),children:children})};const Body=props=>{const{children:children,className:className}=props;return jsx("div",{className:classnames("layout_body",globalProps(props),className),children:children})};const Item=props=>{const{children:children,className:className,size:size="sm"}=props;const sizeClass=`size_${size}`;return jsx("div",{className:classnames("layout_item",sizeClass,globalProps(props),className),children:children})};const Header=props=>{const{children:children,className:className}=props;return jsx("div",{className:classnames("layout_header",globalProps(props),className),children:children})};const Footer=props=>{const{children:children,className:className}=props;return jsx("div",{className:classnames("layout_footer",globalProps(props),className),children:children})};const Layout=props=>{const{aria:aria={},children:children,className:className,collapse:collapse="md",dark:dark=false,data:data={},full:full=false,htmlOptions:htmlOptions={},position:position="left",responsive:responsive=false,size:size="md",layout:layout="sidebar",variant:variant="light",transparent:transparent=false}=props;const responsiveClass=responsive?"_responsive":"";const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const layoutCss=layout=="collection"?`pb_layout_kit_${layout}`:layout=="kanban"?`pb_layout_kit_${layout}${responsiveClass}`:buildCss(`pb_layout_kit_${layout}`,`size_${size}`,position,variant,{dark:dark,transparent:transparent,full:full});const layoutCollapseCss=layout=="collection"?"":layout=="kanban"?"":buildCss("layout",position,"collapse",collapse);const layoutChildren=React__default.Children.toArray(children);const subComponentTags=tagName=>layoutChildren.filter((c=>{var _a;return((_a=c.type)==null?void 0:_a.displayName)===tagName})).map(((child,i)=>React__default.cloneElement(child,{key:`${tagName.toLowerCase()}-${i}`})));const nonSideChildren=layoutChildren.filter((child=>{var _a;return((_a=child.type)==null?void 0:_a.displayName)!=="Side"}));const filteredProps={...props};filteredProps==null?true:delete filteredProps.position;return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classnames(layoutCss,layoutCollapseCss,className,globalProps(filteredProps)),children:[subComponentTags("Side"),nonSideChildren]})};Layout.Side=Side;Layout.Body=Body;Layout.Item=Item;Layout.Header=Header;Layout.Footer=Footer;const useKbdControls=api=>{const[cmdKey,setCmdKey]=useState("");useEffect((()=>{const handleKeyDown=({key:key})=>{const keyCmd=key.toLowerCase();setCmdKey(keyCmd);switch(keyCmd){case"escape":{api.onClose();break}case"arrowleft":{api.onArrowLeft();break}case"arrowright":{api.onArrowRight();break}}};window.addEventListener("keydown",handleKeyDown);return()=>{window.removeEventListener("keydown",handleKeyDown)}}),[api]);return cmdKey};const LightboxContext=React__default.createContext({});const LightboxHeader=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},onClickRight:onClickRight,spacing:spacing="between",text:text2,navRight:navRight,title:title,closeable:closeable=true,icon:icon="times"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const api=useContext(LightboxContext);const headerCSS=buildCss("lightbox_header");const headerSpacing=globalProps(props,{paddingY:"sm"});const handleOnLightboxClose=()=>api.onClose();const HeaderBody=()=>jsxs(React__default.Fragment,{children:[jsx(FlexItem,{flex:"1",marginLeft:"sm",children:jsx(CircleIconButton,{dark:true,icon:icon,onClick:handleOnLightboxClose,variant:"link"})}),title&&text2&&jsx(FlexItem,{flex:"5",children:jsx(Flex,{justify:"center",children:jsxs(Flex,{align:"center",orientation:"column",children:[typeof title==="string"?jsx(Title,{dark:true,paddingBottom:"xxs",size:4,text:title}):jsx(Flex,{className:"custom-header",justify:"center",children:title}),typeof text2==="string"?jsx(Caption,{dark:true,children:text2}):jsx(Flex,{className:"custom-header",justify:"center",children:text2})]})})}),jsx(FlexItem,{flex:"1",children:jsx(Flex,{justify:"end",children:jsx(Button,{className:"nav-right-btn",dark:true,htmlType:"button",onClick:onClickRight,text:navRight,variant:"link"})})})]});return jsx("div",{className:"carousel-header",children:jsxs(Flex,{...ariaProps,...dataProps,...htmlProps,className:classnames(headerCSS,headerSpacing,className),spacing:spacing,children:[closeable&&jsx(HeaderBody,{}),children]})})};var roundNumber=function(num,decimal){return Number(num.toFixed(decimal))};var checkIsNumber=function(num,defaultValue){return defaultValue};var handleCallback=function(context,event,callback){if(callback&&typeof callback==="function"){callback(context,event)}};var easeOut=function(t){return-Math.cos(t*Math.PI)/2+.5};var linear=function(t){return t};var easeInQuad=function(t){return t*t};var easeOutQuad=function(t){return t*(2-t)};var easeInOutQuad=function(t){return t<.5?2*t*t:-1+(4-2*t)*t};var easeInCubic=function(t){return t*t*t};var easeOutCubic=function(t){return--t*t*t+1};var easeInOutCubic=function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1};var easeInQuart=function(t){return t*t*t*t};var easeOutQuart=function(t){return 1- --t*t*t*t};var easeInOutQuart=function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t};var easeInQuint=function(t){return t*t*t*t*t};var easeOutQuint=function(t){return 1+--t*t*t*t*t};var easeInOutQuint=function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t};var animations={easeOut:easeOut,linear:linear,easeInQuad:easeInQuad,easeOutQuad:easeOutQuad,easeInOutQuad:easeInOutQuad,easeInCubic:easeInCubic,easeOutCubic:easeOutCubic,easeInOutCubic:easeInOutCubic,easeInQuart:easeInQuart,easeOutQuart:easeOutQuart,easeInOutQuart:easeInOutQuart,easeInQuint:easeInQuint,easeOutQuint:easeOutQuint,easeInOutQuint:easeInOutQuint};var handleCancelAnimationFrame=function(animation){if(typeof animation==="number"){cancelAnimationFrame(animation)}};var handleCancelAnimation=function(contextInstance){if(!contextInstance.mounted)return;handleCancelAnimationFrame(contextInstance.animation);contextInstance.animate=false;contextInstance.animation=null;contextInstance.velocity=null};function handleSetupAnimation(contextInstance,animationName,animationTime,callback){if(!contextInstance.mounted)return;var startTime=(new Date).getTime();var lastStep=1;handleCancelAnimation(contextInstance);contextInstance.animation=function(){if(!contextInstance.mounted){return handleCancelAnimationFrame(contextInstance.animation)}var frameTime=(new Date).getTime()-startTime;var animationProgress=frameTime/animationTime;var animationType=animations[animationName];var step=animationType(animationProgress);if(frameTime>=animationTime){callback(lastStep);contextInstance.animation=null}else if(contextInstance.animation){callback(step);requestAnimationFrame(contextInstance.animation)}};requestAnimationFrame(contextInstance.animation)}function isValidTargetState(targetState){var scale=targetState.scale,positionX=targetState.positionX,positionY=targetState.positionY;if(Number.isNaN(scale)||Number.isNaN(positionX)||Number.isNaN(positionY)){return false}return true}function animate(contextInstance,targetState,animationTime,animationName){var isValid=isValidTargetState(targetState);if(!contextInstance.mounted||!isValid)return;var setTransformState=contextInstance.setTransformState;var _a=contextInstance.transformState,scale=_a.scale,positionX=_a.positionX,positionY=_a.positionY;var scaleDiff=targetState.scale-scale;var positionXDiff=targetState.positionX-positionX;var positionYDiff=targetState.positionY-positionY;if(animationTime===0){setTransformState(targetState.scale,targetState.positionX,targetState.positionY)}else{handleSetupAnimation(contextInstance,animationName,animationTime,(function(step){var newScale=scale+scaleDiff*step;var newPositionX=positionX+positionXDiff*step;var newPositionY=positionY+positionYDiff*step;setTransformState(newScale,newPositionX,newPositionY)}))}}function getComponentsSizes(wrapperComponent,contentComponent,newScale){var wrapperWidth=wrapperComponent.offsetWidth;var wrapperHeight=wrapperComponent.offsetHeight;var contentWidth=contentComponent.offsetWidth;var contentHeight=contentComponent.offsetHeight;var newContentWidth=contentWidth*newScale;var newContentHeight=contentHeight*newScale;var newDiffWidth=wrapperWidth-newContentWidth;var newDiffHeight=wrapperHeight-newContentHeight;return{wrapperWidth:wrapperWidth,wrapperHeight:wrapperHeight,newContentWidth:newContentWidth,newDiffWidth:newDiffWidth,newContentHeight:newContentHeight,newDiffHeight:newDiffHeight}}var getBounds=function(wrapperWidth,newContentWidth,diffWidth,wrapperHeight,newContentHeight,diffHeight,centerZoomedOut){var scaleWidthFactor=wrapperWidth>newContentWidth?diffWidth*(centerZoomedOut?1:.5):0;var scaleHeightFactor=wrapperHeight>newContentHeight?diffHeight*(centerZoomedOut?1:.5):0;var minPositionX=wrapperWidth-newContentWidth-scaleWidthFactor;var maxPositionX=scaleWidthFactor;var minPositionY=wrapperHeight-newContentHeight-scaleHeightFactor;var maxPositionY=scaleHeightFactor;return{minPositionX:minPositionX,maxPositionX:maxPositionX,minPositionY:minPositionY,maxPositionY:maxPositionY}};var calculateBounds=function(contextInstance,newScale){var wrapperComponent=contextInstance.wrapperComponent,contentComponent=contextInstance.contentComponent;var centerZoomedOut=contextInstance.setup.centerZoomedOut;if(!wrapperComponent||!contentComponent){throw new Error("Components are not mounted")}var _a=getComponentsSizes(wrapperComponent,contentComponent,newScale),wrapperWidth=_a.wrapperWidth,wrapperHeight=_a.wrapperHeight,newContentWidth=_a.newContentWidth,newDiffWidth=_a.newDiffWidth,newContentHeight=_a.newContentHeight,newDiffHeight=_a.newDiffHeight;var bounds=getBounds(wrapperWidth,newContentWidth,newDiffWidth,wrapperHeight,newContentHeight,newDiffHeight,Boolean(centerZoomedOut));return bounds};var boundLimiter=function(value,minBound,maxBound,isActive){if(!isActive)return roundNumber(value,2);if(value<minBound)return roundNumber(minBound,2);if(value>maxBound)return roundNumber(maxBound,2);return roundNumber(value,2)};var handleCalculateBounds=function(contextInstance,newScale){var bounds=calculateBounds(contextInstance,newScale);contextInstance.bounds=bounds;return bounds};function getMouseBoundedPosition(positionX,positionY,bounds,limitToBounds,paddingValueX,paddingValueY,wrapperComponent){var minPositionX=bounds.minPositionX,minPositionY=bounds.minPositionY,maxPositionX=bounds.maxPositionX,maxPositionY=bounds.maxPositionY;var paddingX=0;var paddingY=0;if(wrapperComponent){paddingX=paddingValueX;paddingY=paddingValueY}var x=boundLimiter(positionX,minPositionX-paddingX,maxPositionX+paddingX,limitToBounds);var y=boundLimiter(positionY,minPositionY-paddingY,maxPositionY+paddingY,limitToBounds);return{x:x,y:y}}function handleCalculateZoomPositions(contextInstance,mouseX,mouseY,newScale,bounds,limitToBounds){var _a=contextInstance.transformState,scale=_a.scale,positionX=_a.positionX,positionY=_a.positionY;var scaleDifference=newScale-scale;if(typeof mouseX!=="number"||typeof mouseY!=="number"){console.error("Mouse X and Y position were not provided!");return{x:positionX,y:positionY}}var calculatedPositionX=positionX-mouseX*scaleDifference;var calculatedPositionY=positionY-mouseY*scaleDifference;var newPositions=getMouseBoundedPosition(calculatedPositionX,calculatedPositionY,bounds,limitToBounds,0,0,null);return newPositions}function checkZoomBounds(zoom,minScale,maxScale,zoomPadding,enablePadding){var scalePadding=enablePadding?zoomPadding:0;var minScaleWithPadding=minScale-scalePadding;if(!Number.isNaN(maxScale)&&zoom>=maxScale)return maxScale;if(!Number.isNaN(minScale)&&zoom<=minScaleWithPadding)return minScaleWithPadding;return zoom}var isPanningStartAllowed=function(contextInstance,event){var excluded=contextInstance.setup.panning.excluded;var isInitialized=contextInstance.isInitialized,wrapperComponent=contextInstance.wrapperComponent;var target=event.target;var isWrapperChild=wrapperComponent===null||wrapperComponent===void 0?void 0:wrapperComponent.contains(target);var isAllowed=isInitialized&&target&&isWrapperChild;if(!isAllowed)return false;var isExcluded=isExcludedNode(target,excluded);if(isExcluded)return false;return true};var isPanningAllowed=function(contextInstance){var isInitialized=contextInstance.isInitialized,isPanning=contextInstance.isPanning,setup=contextInstance.setup;var disabled=setup.panning.disabled;var isAllowed=isInitialized&&isPanning&&!disabled;if(!isAllowed)return false;return true};var handlePanningSetup=function(contextInstance,event){var _a=contextInstance.transformState,positionX=_a.positionX,positionY=_a.positionY;contextInstance.isPanning=true;var x=event.clientX;var y=event.clientY;contextInstance.startCoords={x:x-positionX,y:y-positionY}};var handleTouchPanningSetup=function(contextInstance,event){var touches=event.touches;var _a=contextInstance.transformState,positionX=_a.positionX,positionY=_a.positionY;contextInstance.isPanning=true;var oneFingerTouch=touches.length===1;if(oneFingerTouch){var x=touches[0].clientX;var y=touches[0].clientY;contextInstance.startCoords={x:x-positionX,y:y-positionY}}};function handlePanToBounds(contextInstance){var _a=contextInstance.transformState,positionX=_a.positionX,positionY=_a.positionY,scale=_a.scale;var _b=contextInstance.setup,disabled=_b.disabled,limitToBounds=_b.limitToBounds,centerZoomedOut=_b.centerZoomedOut;var wrapperComponent=contextInstance.wrapperComponent;if(disabled||!wrapperComponent||!contextInstance.bounds)return;var _c=contextInstance.bounds,maxPositionX=_c.maxPositionX,minPositionX=_c.minPositionX,maxPositionY=_c.maxPositionY,minPositionY=_c.minPositionY;var xChanged=positionX>maxPositionX||positionX<minPositionX;var yChanged=positionY>maxPositionY||positionY<minPositionY;var mousePosX=positionX>maxPositionX?wrapperComponent.offsetWidth:contextInstance.setup.minPositionX||0;var mousePosY=positionY>maxPositionY?wrapperComponent.offsetHeight:contextInstance.setup.minPositionY||0;var _d=handleCalculateZoomPositions(contextInstance,mousePosX,mousePosY,scale,contextInstance.bounds,limitToBounds||centerZoomedOut),x=_d.x,y=_d.y;return{scale:scale,positionX:xChanged?x:positionX,positionY:yChanged?y:positionY}}function handleNewPosition(contextInstance,newPositionX,newPositionY,paddingValueX,paddingValueY){var limitToBounds=contextInstance.setup.limitToBounds;var wrapperComponent=contextInstance.wrapperComponent,bounds=contextInstance.bounds;var _a=contextInstance.transformState,scale=_a.scale,positionX=_a.positionX,positionY=_a.positionY;if(wrapperComponent===null||bounds===null||newPositionX===positionX&&newPositionY===positionY){return}var _b=getMouseBoundedPosition(newPositionX,newPositionY,bounds,limitToBounds,paddingValueX,paddingValueY,wrapperComponent),x=_b.x,y=_b.y;contextInstance.setTransformState(scale,x,y)}var getPanningClientPosition=function(contextInstance,clientX,clientY){var startCoords=contextInstance.startCoords,transformState=contextInstance.transformState;var panning=contextInstance.setup.panning;var lockAxisX=panning.lockAxisX,lockAxisY=panning.lockAxisY;var positionX=transformState.positionX,positionY=transformState.positionY;if(!startCoords){return{x:positionX,y:positionY}}var mouseX=clientX-startCoords.x;var mouseY=clientY-startCoords.y;var newPositionX=lockAxisX?positionX:mouseX;var newPositionY=lockAxisY?positionY:mouseY;return{x:newPositionX,y:newPositionY}};var getPaddingValue=function(contextInstance,size){var setup=contextInstance.setup,transformState=contextInstance.transformState;var scale=transformState.scale;var minScale=setup.minScale,disablePadding=setup.disablePadding;if(size>0&&scale>=minScale&&!disablePadding){return size}return 0};var isVelocityCalculationAllowed=function(contextInstance){var mounted=contextInstance.mounted;var _a=contextInstance.setup,disabled=_a.disabled,velocityAnimation=_a.velocityAnimation;var scale=contextInstance.transformState.scale;var disabledVelocity=velocityAnimation.disabled;var isAllowed=!disabledVelocity||scale>1||!disabled||mounted;if(!isAllowed)return false;return true};var isVelocityAllowed=function(contextInstance){var mounted=contextInstance.mounted,velocity=contextInstance.velocity,bounds=contextInstance.bounds;var _a=contextInstance.setup,disabled=_a.disabled,velocityAnimation=_a.velocityAnimation;var scale=contextInstance.transformState.scale;var disabledVelocity=velocityAnimation.disabled;var isAllowed=!disabledVelocity||scale>1||!disabled||mounted;if(!isAllowed)return false;if(!velocity||!bounds)return false;return true};function getVelocityMoveTime(contextInstance,velocity){var velocityAnimation=contextInstance.setup.velocityAnimation;var equalToMove=velocityAnimation.equalToMove,animationTime=velocityAnimation.animationTime,sensitivity=velocityAnimation.sensitivity;if(equalToMove){return animationTime*velocity*sensitivity}return animationTime}function getVelocityPosition(newPosition,startPosition,currentPosition,isLocked,limitToBounds,minPosition,maxPosition,minTarget,maxTarget,step){if(limitToBounds){if(startPosition>maxPosition&¤tPosition>maxPosition){var calculatedPosition=maxPosition+(newPosition-maxPosition)*step;if(calculatedPosition>maxTarget)return maxTarget;if(calculatedPosition<maxPosition)return maxPosition;return calculatedPosition}if(startPosition<minPosition&¤tPosition<minPosition){var calculatedPosition=minPosition+(newPosition-minPosition)*step;if(calculatedPosition<minTarget)return minTarget;if(calculatedPosition>minPosition)return minPosition;return calculatedPosition}}if(isLocked)return startPosition;return boundLimiter(newPosition,minPosition,maxPosition,limitToBounds)}function getSizeMultiplier(wrapperComponent,equalToMove){var defaultMultiplier=1;if(equalToMove){return Math.min(defaultMultiplier,wrapperComponent.offsetWidth/window.innerWidth)}return defaultMultiplier}function handleCalculateVelocity(contextInstance,position){var isAllowed=isVelocityCalculationAllowed(contextInstance);if(!isAllowed){return}var lastMousePosition=contextInstance.lastMousePosition,velocityTime=contextInstance.velocityTime,setup=contextInstance.setup;var wrapperComponent=contextInstance.wrapperComponent;var equalToMove=setup.velocityAnimation.equalToMove;var now=Date.now();if(lastMousePosition&&velocityTime&&wrapperComponent){var sizeMultiplier=getSizeMultiplier(wrapperComponent,equalToMove);var distanceX=position.x-lastMousePosition.x;var distanceY=position.y-lastMousePosition.y;var velocityX=distanceX/sizeMultiplier;var velocityY=distanceY/sizeMultiplier;var interval=now-velocityTime;var speed=distanceX*distanceX+distanceY*distanceY;var velocity=Math.sqrt(speed)/interval;contextInstance.velocity={velocityX:velocityX,velocityY:velocityY,total:velocity}}contextInstance.lastMousePosition=position;contextInstance.velocityTime=now}function handleVelocityPanning(contextInstance){var velocity=contextInstance.velocity,bounds=contextInstance.bounds,setup=contextInstance.setup,wrapperComponent=contextInstance.wrapperComponent;var isAllowed=isVelocityAllowed(contextInstance);if(!isAllowed||!velocity||!bounds||!wrapperComponent){return}var velocityX=velocity.velocityX,velocityY=velocity.velocityY,total=velocity.total;var maxPositionX=bounds.maxPositionX,minPositionX=bounds.minPositionX,maxPositionY=bounds.maxPositionY,minPositionY=bounds.minPositionY;var limitToBounds=setup.limitToBounds,alignmentAnimation=setup.alignmentAnimation;var zoomAnimation=setup.zoomAnimation,panning=setup.panning;var lockAxisY=panning.lockAxisY,lockAxisX=panning.lockAxisX;var animationType=zoomAnimation.animationType;var sizeX=alignmentAnimation.sizeX,sizeY=alignmentAnimation.sizeY,velocityAlignmentTime=alignmentAnimation.velocityAlignmentTime;var alignAnimationTime=velocityAlignmentTime;var moveAnimationTime=getVelocityMoveTime(contextInstance,total);var finalAnimationTime=Math.max(moveAnimationTime,alignAnimationTime);var paddingValueX=getPaddingValue(contextInstance,sizeX);var paddingValueY=getPaddingValue(contextInstance,sizeY);var paddingX=paddingValueX*wrapperComponent.offsetWidth/100;var paddingY=paddingValueY*wrapperComponent.offsetHeight/100;var maxTargetX=maxPositionX+paddingX;var minTargetX=minPositionX-paddingX;var maxTargetY=maxPositionY+paddingY;var minTargetY=minPositionY-paddingY;var startState=contextInstance.transformState;var startTime=(new Date).getTime();handleSetupAnimation(contextInstance,animationType,finalAnimationTime,(function(step){var _a=contextInstance.transformState,scale=_a.scale,positionX=_a.positionX,positionY=_a.positionY;var frameTime=(new Date).getTime()-startTime;var animationProgress=frameTime/alignAnimationTime;var alignAnimation=animations[alignmentAnimation.animationType];var alignStep=1-alignAnimation(Math.min(1,animationProgress));var customStep=1-step;var newPositionX=positionX+velocityX*customStep;var newPositionY=positionY+velocityY*customStep;var currentPositionX=getVelocityPosition(newPositionX,startState.positionX,positionX,lockAxisX,limitToBounds,minPositionX,maxPositionX,minTargetX,maxTargetX,alignStep);var currentPositionY=getVelocityPosition(newPositionY,startState.positionY,positionY,lockAxisY,limitToBounds,minPositionY,maxPositionY,minTargetY,maxTargetY,alignStep);if(positionX!==newPositionX||positionY!==newPositionY){contextInstance.setTransformState(scale,currentPositionX,currentPositionY)}}))}function handlePanningStart(contextInstance,event){var scale=contextInstance.transformState.scale;handleCancelAnimation(contextInstance);handleCalculateBounds(contextInstance,scale);if(window.TouchEvent!==void 0&&event instanceof TouchEvent){handleTouchPanningSetup(contextInstance,event)}else{handlePanningSetup(contextInstance,event)}}function handleAlignToBounds(contextInstance){var scale=contextInstance.transformState.scale;var _a=contextInstance.setup,minScale=_a.minScale,alignmentAnimation=_a.alignmentAnimation;var disabled=alignmentAnimation.disabled,sizeX=alignmentAnimation.sizeX,sizeY=alignmentAnimation.sizeY,animationTime=alignmentAnimation.animationTime,animationType=alignmentAnimation.animationType;var isDisabled=disabled||scale<minScale||!sizeX&&!sizeY;if(isDisabled)return;var targetState=handlePanToBounds(contextInstance);if(targetState){animate(contextInstance,targetState,animationTime,animationType)}}function handlePanning(contextInstance,clientX,clientY){var startCoords=contextInstance.startCoords,setup=contextInstance.setup;var _a=setup.alignmentAnimation,sizeX=_a.sizeX,sizeY=_a.sizeY;if(!startCoords)return;var _b=getPanningClientPosition(contextInstance,clientX,clientY),x=_b.x,y=_b.y;var paddingValueX=getPaddingValue(contextInstance,sizeX);var paddingValueY=getPaddingValue(contextInstance,sizeY);handleCalculateVelocity(contextInstance,{x:x,y:y});handleNewPosition(contextInstance,x,y,paddingValueX,paddingValueY)}function handlePanningEnd(contextInstance){if(contextInstance.isPanning){var velocityDisabled=contextInstance.setup.panning.velocityDisabled;var velocity=contextInstance.velocity,wrapperComponent=contextInstance.wrapperComponent,contentComponent=contextInstance.contentComponent;contextInstance.isPanning=false;contextInstance.animate=false;contextInstance.animation=null;var wrapperRect=wrapperComponent===null||wrapperComponent===void 0?void 0:wrapperComponent.getBoundingClientRect();var contentRect=contentComponent===null||contentComponent===void 0?void 0:contentComponent.getBoundingClientRect();var wrapperWidth=(wrapperRect===null||wrapperRect===void 0?void 0:wrapperRect.width)||0;var wrapperHeight=(wrapperRect===null||wrapperRect===void 0?void 0:wrapperRect.height)||0;var contentWidth=(contentRect===null||contentRect===void 0?void 0:contentRect.width)||0;var contentHeight=(contentRect===null||contentRect===void 0?void 0:contentRect.height)||0;var isZoomed=wrapperWidth<contentWidth||wrapperHeight<contentHeight;var shouldAnimate=!velocityDisabled&&velocity&&(velocity===null||velocity===void 0?void 0:velocity.total)>.1&&isZoomed;if(shouldAnimate){handleVelocityPanning(contextInstance)}else{handleAlignToBounds(contextInstance)}}}function handleZoomToPoint(contextInstance,scale,mouseX,mouseY){var _a=contextInstance.setup,minScale=_a.minScale,maxScale=_a.maxScale,limitToBounds=_a.limitToBounds;var newScale=checkZoomBounds(roundNumber(scale,2),minScale,maxScale,0,false);var bounds=handleCalculateBounds(contextInstance,newScale);var _b=handleCalculateZoomPositions(contextInstance,mouseX,mouseY,newScale,bounds,limitToBounds),x=_b.x,y=_b.y;return{scale:newScale,positionX:x,positionY:y}}function handleAlignToScaleBounds(contextInstance,mousePositionX,mousePositionY){var scale=contextInstance.transformState.scale;var wrapperComponent=contextInstance.wrapperComponent;var _a=contextInstance.setup,minScale=_a.minScale,limitToBounds=_a.limitToBounds,zoomAnimation=_a.zoomAnimation;var disabled=zoomAnimation.disabled,animationTime=zoomAnimation.animationTime,animationType=zoomAnimation.animationType;var isDisabled=disabled||scale>=minScale;if(scale>=1||limitToBounds){handleAlignToBounds(contextInstance)}if(isDisabled||!wrapperComponent||!contextInstance.mounted)return;var mouseX=mousePositionX||wrapperComponent.offsetWidth/2;var mouseY=mousePositionY||wrapperComponent.offsetHeight/2;var targetState=handleZoomToPoint(contextInstance,minScale,mouseX,mouseY);if(targetState){animate(contextInstance,targetState,animationTime,animationType)}}var __assign=function(){__assign=Object.assign||function __assign2(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};return __assign.apply(this,arguments)};function __spreadArray(to,from,pack){for(var i=0,l=from.length,ar;i<l;i++){if(ar||!(i in from)){if(!ar)ar=Array.prototype.slice.call(from,0,i);ar[i]=from[i]}}return to.concat(ar||Array.prototype.slice.call(from))}var initialState={previousScale:1,scale:1,positionX:0,positionY:0};var initialSetup={disabled:false,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:true,centerZoomedOut:false,centerOnInit:false,disablePadding:false,wheel:{step:.2,disabled:false,wheelDisabled:false,touchPadDisabled:false,activationKeys:[],excluded:[]},panning:{disabled:false,velocityDisabled:false,lockAxisX:false,lockAxisY:false,activationKeys:[],excluded:[]},pinch:{step:5,disabled:false,excluded:[]},doubleClick:{disabled:false,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:false,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:false,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:false,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:true}};var createState=function(props){var _a,_b,_c,_d;return{previousScale:(_a=props.initialScale)!==null&&_a!==void 0?_a:initialState.scale,scale:(_b=props.initialScale)!==null&&_b!==void 0?_b:initialState.scale,positionX:(_c=props.initialPositionX)!==null&&_c!==void 0?_c:initialState.positionX,positionY:(_d=props.initialPositionY)!==null&&_d!==void 0?_d:initialState.positionY}};var createSetup=function(props){var newSetup=__assign({},initialSetup);Object.keys(props).forEach((function(key){var validValue=typeof props[key]!=="undefined";var validParameter=typeof initialSetup[key]!=="undefined";if(validParameter&&validValue){var dataType=Object.prototype.toString.call(initialSetup[key]);var isObject2=dataType==="[object Object]";var isArray=dataType==="[object Array]";if(isObject2){newSetup[key]=__assign(__assign({},initialSetup[key]),props[key])}else if(isArray){newSetup[key]=__spreadArray(__spreadArray([],initialSetup[key],true),props[key])}else{newSetup[key]=props[key]}}}));return newSetup};var handleCalculateButtonZoom=function(contextInstance,delta,step){var scale=contextInstance.transformState.scale;var wrapperComponent=contextInstance.wrapperComponent,setup=contextInstance.setup;var maxScale=setup.maxScale,minScale=setup.minScale,zoomAnimation=setup.zoomAnimation;var size=zoomAnimation.size;if(!wrapperComponent){throw new Error("Wrapper is not mounted")}var targetScale=scale*Math.exp(delta*step);var newScale=checkZoomBounds(roundNumber(targetScale,3),minScale,maxScale,size,false);return newScale};function handleZoomToViewCenter(contextInstance,delta,step,animationTime,animationType){var wrapperComponent=contextInstance.wrapperComponent;var _a=contextInstance.transformState,scale=_a.scale,positionX=_a.positionX,positionY=_a.positionY;if(!wrapperComponent)return console.error("No WrapperComponent found");var wrapperWidth=wrapperComponent.offsetWidth;var wrapperHeight=wrapperComponent.offsetHeight;var mouseX=(wrapperWidth/2-positionX)/scale;var mouseY=(wrapperHeight/2-positionY)/scale;var newScale=handleCalculateButtonZoom(contextInstance,delta,step);var targetState=handleZoomToPoint(contextInstance,newScale,mouseX,mouseY);if(!targetState){return console.error("Error during zoom event. New transformation state was not calculated.")}animate(contextInstance,targetState,animationTime,animationType)}function resetTransformations(contextInstance,animationTime,animationType,onResetTransformation){var setup=contextInstance.setup,wrapperComponent=contextInstance.wrapperComponent;var limitToBounds=setup.limitToBounds;var initialTransformation=createState(contextInstance.props);var _a=contextInstance.transformState,scale=_a.scale,positionX=_a.positionX,positionY=_a.positionY;if(!wrapperComponent)return;var newBounds=calculateBounds(contextInstance,initialTransformation.scale);var boundedPositions=getMouseBoundedPosition(initialTransformation.positionX,initialTransformation.positionY,newBounds,limitToBounds,0,0,wrapperComponent);var newState={scale:initialTransformation.scale,positionX:boundedPositions.x,positionY:boundedPositions.y};if(scale===initialTransformation.scale&&positionX===initialTransformation.positionX&&positionY===initialTransformation.positionY){return}onResetTransformation===null||onResetTransformation===void 0?void 0:onResetTransformation();animate(contextInstance,newState,animationTime,animationType)}function getOffset(element,wrapper,content,state){var offset2=element.getBoundingClientRect();var wrapperOffset=wrapper.getBoundingClientRect();var contentOffset=content.getBoundingClientRect();var xOff=wrapperOffset.x*state.scale;var yOff=wrapperOffset.y*state.scale;return{x:(offset2.x-contentOffset.x+xOff)/state.scale,y:(offset2.y-contentOffset.y+yOff)/state.scale}}function calculateZoomToNode(contextInstance,node,customZoom){var wrapperComponent=contextInstance.wrapperComponent,contentComponent=contextInstance.contentComponent,transformState=contextInstance.transformState;var _a=contextInstance.setup,limitToBounds=_a.limitToBounds,minScale=_a.minScale,maxScale=_a.maxScale;if(!wrapperComponent||!contentComponent)return transformState;var wrapperRect=wrapperComponent.getBoundingClientRect();var nodeRect=node.getBoundingClientRect();var nodeOffset=getOffset(node,wrapperComponent,contentComponent,transformState);var nodeLeft=nodeOffset.x;var nodeTop=nodeOffset.y;var nodeWidth=nodeRect.width/transformState.scale;var nodeHeight=nodeRect.height/transformState.scale;var scaleX=wrapperComponent.offsetWidth/nodeWidth;var scaleY=wrapperComponent.offsetHeight/nodeHeight;var newScale=checkZoomBounds(customZoom||Math.min(scaleX,scaleY),minScale,maxScale,0,false);var offsetX=(wrapperRect.width-nodeWidth*newScale)/2;var offsetY=(wrapperRect.height-nodeHeight*newScale)/2;var newPositionX=(wrapperRect.left-nodeLeft)*newScale+offsetX;var newPositionY=(wrapperRect.top-nodeTop)*newScale+offsetY;var bounds=calculateBounds(contextInstance,newScale);var _b=getMouseBoundedPosition(newPositionX,newPositionY,bounds,limitToBounds,0,0,wrapperComponent),x=_b.x,y=_b.y;return{positionX:x,positionY:y,scale:newScale}}var zoomIn=function(contextInstance){return function(step,animationTime,animationType){if(step===void 0){step=.5}if(animationTime===void 0){animationTime=300}if(animationType===void 0){animationType="easeOut"}handleZoomToViewCenter(contextInstance,1,step,animationTime,animationType)}};var zoomOut=function(contextInstance){return function(step,animationTime,animationType){if(step===void 0){step=.5}if(animationTime===void 0){animationTime=300}if(animationType===void 0){animationType="easeOut"}handleZoomToViewCenter(contextInstance,-1,step,animationTime,animationType)}};var setTransform=function(contextInstance){return function(newPositionX,newPositionY,newScale,animationTime,animationType){if(animationTime===void 0){animationTime=300}if(animationType===void 0){animationType="easeOut"}var _a=contextInstance.transformState,positionX=_a.positionX,positionY=_a.positionY,scale=_a.scale;var wrapperComponent=contextInstance.wrapperComponent,contentComponent=contextInstance.contentComponent;var disabled=contextInstance.setup.disabled;if(disabled||!wrapperComponent||!contentComponent)return;var targetState={positionX:Number.isNaN(newPositionX)?positionX:newPositionX,positionY:Number.isNaN(newPositionY)?positionY:newPositionY,scale:Number.isNaN(newScale)?scale:newScale};animate(contextInstance,targetState,animationTime,animationType)}};var resetTransform=function(contextInstance){return function(animationTime,animationType){if(animationTime===void 0){animationTime=200}if(animationType===void 0){animationType="easeOut"}resetTransformations(contextInstance,animationTime,animationType)}};var centerView=function(contextInstance){return function(scale,animationTime,animationType){if(animationTime===void 0){animationTime=200}if(animationType===void 0){animationType="easeOut"}var transformState=contextInstance.transformState,wrapperComponent=contextInstance.wrapperComponent,contentComponent=contextInstance.contentComponent;if(wrapperComponent&&contentComponent){var targetState=getCenterPosition(scale||transformState.scale,wrapperComponent,contentComponent);animate(contextInstance,targetState,animationTime,animationType)}}};var zoomToElement=function(contextInstance){return function(node,scale,animationTime,animationType){if(animationTime===void 0){animationTime=600}if(animationType===void 0){animationType="easeOut"}handleCancelAnimation(contextInstance);var wrapperComponent=contextInstance.wrapperComponent;var target=typeof node==="string"?document.getElementById(node):node;if(wrapperComponent&&target&&wrapperComponent.contains(target)){var targetState=calculateZoomToNode(contextInstance,target,scale);animate(contextInstance,targetState,animationTime,animationType)}}};var getContext=function(contextInstance){return{instance:contextInstance,state:contextInstance.transformState,zoomIn:zoomIn(contextInstance),zoomOut:zoomOut(contextInstance),setTransform:setTransform(contextInstance),resetTransform:resetTransform(contextInstance),centerView:centerView(contextInstance),zoomToElement:zoomToElement(contextInstance)}};var passiveSupported=false;function makePassiveEventOption(){try{var options={get passive(){passiveSupported=true;return false}};return options}catch(err){passiveSupported=false;return passiveSupported}}var isExcludedNode=function(node,excluded){var targetTagName=node.tagName.toUpperCase();var isExcludedTag=excluded.find((function(tag){return tag.toUpperCase()===targetTagName}));if(isExcludedTag)return true;var isExcludedClassName=excluded.find((function(className){return node.classList.contains(className)}));if(isExcludedClassName)return true;return false};var cancelTimeout=function(timeout){if(timeout){clearTimeout(timeout)}};var getTransformStyles=function(x,y,scale){return"translate(".concat(x,"px, ").concat(y,"px) scale(").concat(scale,")")};var getCenterPosition=function(scale,wrapperComponent,contentComponent){var contentWidth=contentComponent.offsetWidth*scale;var contentHeight=contentComponent.offsetHeight*scale;var centerPositionX=(wrapperComponent.offsetWidth-contentWidth)/2;var centerPositionY=(wrapperComponent.offsetHeight-contentHeight)/2;return{scale:scale,positionX:centerPositionX,positionY:centerPositionY}};function mergeRefs(refs){return function(value){refs.forEach((function(ref){if(typeof ref==="function"){ref(value)}else if(ref!=null){ref.current=value}}))}}var isWheelAllowed=function(contextInstance,event){var _a=contextInstance.setup.wheel,disabled=_a.disabled,wheelDisabled=_a.wheelDisabled,touchPadDisabled=_a.touchPadDisabled,excluded=_a.excluded;var isInitialized=contextInstance.isInitialized,isPanning=contextInstance.isPanning;var target=event.target;var isAllowed=isInitialized&&!isPanning&&!disabled&⌖if(!isAllowed)return false;if(wheelDisabled&&!event.ctrlKey)return false;if(touchPadDisabled&&event.ctrlKey)return false;var isExcluded=isExcludedNode(target,excluded);if(isExcluded)return false;return true};var getDeltaY=function(event){if(event){return event.deltaY<0?1:-1}return 0};function getDelta(event,customDelta){var deltaY=getDeltaY(event);var delta=checkIsNumber(customDelta,deltaY);return delta}function getMousePosition(event,contentComponent,scale){var contentRect=contentComponent.getBoundingClientRect();var mouseX=0;var mouseY=0;if("clientX"in event){mouseX=(event.clientX-contentRect.left)/scale;mouseY=(event.clientY-contentRect.top)/scale}else{var touch=event.touches[0];mouseX=(touch.clientX-contentRect.left)/scale;mouseY=(touch.clientY-contentRect.top)/scale}if(Number.isNaN(mouseX)||Number.isNaN(mouseY))console.error("No mouse or touch offset found");return{x:mouseX,y:mouseY}}var handleCalculateWheelZoom=function(contextInstance,delta,step,disable,getTarget){var scale=contextInstance.transformState.scale;var wrapperComponent=contextInstance.wrapperComponent,setup=contextInstance.setup;var maxScale=setup.maxScale,minScale=setup.minScale,zoomAnimation=setup.zoomAnimation,disablePadding=setup.disablePadding;var size=zoomAnimation.size,disabled=zoomAnimation.disabled;if(!wrapperComponent){throw new Error("Wrapper is not mounted")}var targetScale=scale+delta*(scale-scale*step)*step;var paddingEnabled=disable?false:!disabled;var newScale=checkZoomBounds(roundNumber(targetScale,3),minScale,maxScale,size,paddingEnabled&&!disablePadding);return newScale};var handleWheelZoomStop=function(contextInstance,event){var previousWheelEvent=contextInstance.previousWheelEvent;var scale=contextInstance.transformState.scale;var _a=contextInstance.setup,maxScale=_a.maxScale,minScale=_a.minScale;if(!previousWheelEvent)return false;if(scale<maxScale||scale>minScale)return true;if(Math.sign(previousWheelEvent.deltaY)!==Math.sign(event.deltaY))return true;if(previousWheelEvent.deltaY>0&&previousWheelEvent.deltaY<event.deltaY)return true;if(previousWheelEvent.deltaY<0&&previousWheelEvent.deltaY>event.deltaY)return true;if(Math.sign(previousWheelEvent.deltaY)!==Math.sign(event.deltaY))return true;return false};var isPinchStartAllowed=function(contextInstance,event){var _a=contextInstance.setup.pinch,disabled=_a.disabled,excluded=_a.excluded;var isInitialized=contextInstance.isInitialized;var target=event.target;var isAllowed=isInitialized&&!disabled&⌖if(!isAllowed)return false;var isExcluded=isExcludedNode(target,excluded);if(isExcluded)return false;return true};var isPinchAllowed=function(contextInstance){var disabled=contextInstance.setup.pinch.disabled;var isInitialized=contextInstance.isInitialized,pinchStartDistance=contextInstance.pinchStartDistance;var isAllowed=isInitialized&&!disabled&&pinchStartDistance;if(!isAllowed)return false;return true};var calculateTouchMidPoint=function(event,scale,contentComponent){var contentRect=contentComponent.getBoundingClientRect();var touches=event.touches;var firstPointX=roundNumber(touches[0].clientX-contentRect.left,5);var firstPointY=roundNumber(touches[0].clientY-contentRect.top,5);var secondPointX=roundNumber(touches[1].clientX-contentRect.left,5);var secondPointY=roundNumber(touches[1].clientY-contentRect.top,5);return{x:(firstPointX+secondPointX)/2/scale,y:(firstPointY+secondPointY)/2/scale}};var getTouchDistance=function(event){return Math.sqrt(Math.pow(event.touches[0].pageX-event.touches[1].pageX,2)+Math.pow(event.touches[0].pageY-event.touches[1].pageY,2))};var calculatePinchZoom=function(contextInstance,currentDistance){var pinchStartScale=contextInstance.pinchStartScale,pinchStartDistance=contextInstance.pinchStartDistance,setup=contextInstance.setup;var maxScale=setup.maxScale,minScale=setup.minScale,zoomAnimation=setup.zoomAnimation,disablePadding=setup.disablePadding;var size=zoomAnimation.size,disabled=zoomAnimation.disabled;if(!pinchStartScale||pinchStartDistance===null||!currentDistance){throw new Error("Pinch touches distance was not provided")}if(currentDistance<0){return contextInstance.transformState.scale}var touchProportion=currentDistance/pinchStartDistance;var scaleDifference=touchProportion*pinchStartScale;return checkZoomBounds(roundNumber(scaleDifference,2),minScale,maxScale,size,!disabled&&!disablePadding)};var wheelStopEventTime=160;var wheelAnimationTime=100;var handleWheelStart=function(contextInstance,event){var _a=contextInstance.props,onWheelStart=_a.onWheelStart,onZoomStart=_a.onZoomStart;if(!contextInstance.wheelStopEventTimer){handleCancelAnimation(contextInstance);handleCallback(getContext(contextInstance),event,onWheelStart);handleCallback(getContext(contextInstance),event,onZoomStart)}};var handleWheelZoom=function(contextInstance,event){var _a=contextInstance.props,onWheel=_a.onWheel,onZoom=_a.onZoom;var contentComponent=contextInstance.contentComponent,setup=contextInstance.setup,transformState=contextInstance.transformState;var scale=transformState.scale;var limitToBounds=setup.limitToBounds,centerZoomedOut=setup.centerZoomedOut,zoomAnimation=setup.zoomAnimation,wheel=setup.wheel,disablePadding=setup.disablePadding;var size=zoomAnimation.size,disabled=zoomAnimation.disabled;var step=wheel.step;if(!contentComponent){throw new Error("Component not mounted")}event.preventDefault();event.stopPropagation();var delta=getDelta(event,null);var newScale=handleCalculateWheelZoom(contextInstance,delta,step,!event.ctrlKey);if(scale===newScale)return;var bounds=handleCalculateBounds(contextInstance,newScale);var mousePosition=getMousePosition(event,contentComponent,scale);var isPaddingDisabled=disabled||size===0||centerZoomedOut||disablePadding;var isLimitedToBounds=limitToBounds&&isPaddingDisabled;var _b=handleCalculateZoomPositions(contextInstance,mousePosition.x,mousePosition.y,newScale,bounds,isLimitedToBounds),x=_b.x,y=_b.y;contextInstance.previousWheelEvent=event;contextInstance.setTransformState(newScale,x,y);handleCallback(getContext(contextInstance),event,onWheel);handleCallback(getContext(contextInstance),event,onZoom)};var handleWheelStop=function(contextInstance,event){var _a=contextInstance.props,onWheelStop=_a.onWheelStop,onZoomStop=_a.onZoomStop;cancelTimeout(contextInstance.wheelAnimationTimer);contextInstance.wheelAnimationTimer=setTimeout((function(){if(!contextInstance.mounted)return;handleAlignToScaleBounds(contextInstance,event.x,event.y);contextInstance.wheelAnimationTimer=null}),wheelAnimationTime);var hasStoppedZooming=handleWheelZoomStop(contextInstance,event);if(hasStoppedZooming){cancelTimeout(contextInstance.wheelStopEventTimer);contextInstance.wheelStopEventTimer=setTimeout((function(){if(!contextInstance.mounted)return;contextInstance.wheelStopEventTimer=null;handleCallback(getContext(contextInstance),event,onWheelStop);handleCallback(getContext(contextInstance),event,onZoomStop)}),wheelStopEventTime)}};var handlePinchStart=function(contextInstance,event){var distance=getTouchDistance(event);contextInstance.pinchStartDistance=distance;contextInstance.lastDistance=distance;contextInstance.pinchStartScale=contextInstance.transformState.scale;contextInstance.isPanning=false;handleCancelAnimation(contextInstance)};var handlePinchZoom=function(contextInstance,event){var contentComponent=contextInstance.contentComponent,pinchStartDistance=contextInstance.pinchStartDistance;var scale=contextInstance.transformState.scale;var _a=contextInstance.setup,limitToBounds=_a.limitToBounds,centerZoomedOut=_a.centerZoomedOut,zoomAnimation=_a.zoomAnimation;var disabled=zoomAnimation.disabled,size=zoomAnimation.size;if(pinchStartDistance===null||!contentComponent)return;var midPoint=calculateTouchMidPoint(event,scale,contentComponent);if(!Number.isFinite(midPoint.x)||!Number.isFinite(midPoint.y))return;var currentDistance=getTouchDistance(event);var newScale=calculatePinchZoom(contextInstance,currentDistance);if(newScale===scale)return;var bounds=handleCalculateBounds(contextInstance,newScale);var isPaddingDisabled=disabled||size===0||centerZoomedOut;var isLimitedToBounds=limitToBounds&&isPaddingDisabled;var _b=handleCalculateZoomPositions(contextInstance,midPoint.x,midPoint.y,newScale,bounds,isLimitedToBounds),x=_b.x,y=_b.y;contextInstance.pinchMidpoint=midPoint;contextInstance.lastDistance=currentDistance;contextInstance.setTransformState(newScale,x,y)};var handlePinchStop=function(contextInstance){var pinchMidpoint=contextInstance.pinchMidpoint;contextInstance.velocity=null;contextInstance.lastDistance=null;contextInstance.pinchMidpoint=null;contextInstance.pinchStartScale=null;contextInstance.pinchStartDistance=null;handleAlignToScaleBounds(contextInstance,pinchMidpoint===null||pinchMidpoint===void 0?void 0:pinchMidpoint.x,pinchMidpoint===null||pinchMidpoint===void 0?void 0:pinchMidpoint.y)};var handleDoubleClickStop=function(contextInstance,event){var onZoomStop=contextInstance.props.onZoomStop;var animationTime=contextInstance.setup.doubleClick.animationTime;cancelTimeout(contextInstance.doubleClickStopEventTimer);contextInstance.doubleClickStopEventTimer=setTimeout((function(){contextInstance.doubleClickStopEventTimer=null;handleCallback(getContext(contextInstance),event,onZoomStop)}),animationTime)};var handleDoubleClickResetMode=function(contextInstance,event){var _a=contextInstance.props,onZoomStart=_a.onZoomStart,onZoom=_a.onZoom;var _b=contextInstance.setup.doubleClick,animationTime=_b.animationTime,animationType=_b.animationType;handleCallback(getContext(contextInstance),event,onZoomStart);resetTransformations(contextInstance,animationTime,animationType,(function(){return handleCallback(getContext(contextInstance),event,onZoom)}));handleDoubleClickStop(contextInstance,event)};function handleDoubleClick(contextInstance,event){var setup=contextInstance.setup,doubleClickStopEventTimer=contextInstance.doubleClickStopEventTimer,transformState=contextInstance.transformState,contentComponent=contextInstance.contentComponent;var scale=transformState.scale;var _a=contextInstance.props,onZoomStart=_a.onZoomStart,onZoom=_a.onZoom;var _b=setup.doubleClick,disabled=_b.disabled,mode=_b.mode,step=_b.step,animationTime=_b.animationTime,animationType=_b.animationType;if(disabled)return;if(doubleClickStopEventTimer)return;if(mode==="reset"){return handleDoubleClickResetMode(contextInstance,event)}if(!contentComponent)return console.error("No ContentComponent found");var delta=mode==="zoomOut"?-1:1;var newScale=handleCalculateButtonZoom(contextInstance,delta,step);if(scale===newScale)return;handleCallback(getContext(contextInstance),event,onZoomStart);var mousePosition=getMousePosition(event,contentComponent,scale);var targetState=handleZoomToPoint(contextInstance,newScale,mousePosition.x,mousePosition.y);if(!targetState){return console.error("Error during zoom event. New transformation state was not calculated.")}handleCallback(getContext(contextInstance),event,onZoom);animate(contextInstance,targetState,animationTime,animationType);handleDoubleClickStop(contextInstance,event)}var isDoubleClickAllowed=function(contextInstance,event){var isInitialized=contextInstance.isInitialized,setup=contextInstance.setup,wrapperComponent=contextInstance.wrapperComponent;var _a=setup.doubleClick,disabled=_a.disabled,excluded=_a.excluded;var target=event.target;var isWrapperChild=wrapperComponent===null||wrapperComponent===void 0?void 0:wrapperComponent.contains(target);var isAllowed=isInitialized&&target&&isWrapperChild&&!disabled;if(!isAllowed)return false;var isExcluded=isExcludedNode(target,excluded);if(isExcluded)return false;return true};var ZoomPanPinch=function(){function ZoomPanPinch2(props){var _this=this;this.mounted=true;this.onChangeCallbacks=new Set;this.wrapperComponent=null;this.contentComponent=null;this.isInitialized=false;this.bounds=null;this.previousWheelEvent=null;this.wheelStopEventTimer=null;this.wheelAnimationTimer=null;this.isPanning=false;this.startCoords=null;this.lastTouch=null;this.distance=null;this.lastDistance=null;this.pinchStartDistance=null;this.pinchStartScale=null;this.pinchMidpoint=null;this.doubleClickStopEventTimer=null;this.velocity=null;this.velocityTime=null;this.lastMousePosition=null;this.animate=false;this.animation=null;this.maxBounds=null;this.pressedKeys={};this.mount=function(){_this.initializeWindowEvents()};this.unmount=function(){_this.cleanupWindowEvents()};this.update=function(newProps){handleCalculateBounds(_this,_this.transformState.scale);_this.setup=createSetup(newProps)};this.initializeWindowEvents=function(){var _a;var passive=makePassiveEventOption();var currentDocument=(_a=_this.wrapperComponent)===null||_a===void 0?void 0:_a.ownerDocument;var currentWindow=currentDocument===null||currentDocument===void 0?void 0:currentDocument.defaultView;currentWindow===null||currentWindow===void 0?void 0:currentWindow.addEventListener("mousedown",_this.onPanningStart,passive);currentWindow===null||currentWindow===void 0?void 0:currentWindow.addEventListener("mousemove",_this.onPanning,passive);currentWindow===null||currentWindow===void 0?void 0:currentWindow.addEventListener("mouseup",_this.onPanningStop,passive);currentDocument===null||currentDocument===void 0?void 0:currentDocument.addEventListener("mouseleave",_this.clearPanning,passive);currentWindow===null||currentWindow===void 0?void 0:currentWindow.addEventListener("keyup",_this.setKeyUnPressed,passive);currentWindow===null||currentWindow===void 0?void 0:currentWindow.addEventListener("keydown",_this.setKeyPressed,passive)};this.cleanupWindowEvents=function(){var _a,_b;var passive=makePassiveEventOption();var currentDocument=(_a=_this.wrapperComponent)===null||_a===void 0?void 0:_a.ownerDocument;var currentWindow=currentDocument===null||currentDocument===void 0?void 0:currentDocument.defaultView;currentWindow===null||currentWindow===void 0?void 0:currentWindow.removeEventListener("mousedown",_this.onPanningStart,passive);currentWindow===null||currentWindow===void 0?void 0:currentWindow.removeEventListener("mousemove",_this.onPanning,passive);currentWindow===null||currentWindow===void 0?void 0:currentWindow.removeEventListener("mouseup",_this.onPanningStop,passive);currentDocument===null||currentDocument===void 0?void 0:currentDocument.removeEventListener("mouseleave",_this.clearPanning,passive);currentWindow===null||currentWindow===void 0?void 0:currentWindow.removeEventListener("keyup",_this.setKeyUnPressed,passive);currentWindow===null||currentWindow===void 0?void 0:currentWindow.removeEventListener("keydown",_this.setKeyPressed,passive);document.removeEventListener("mouseleave",_this.clearPanning,passive);handleCancelAnimation(_this);(_b=_this.observer)===null||_b===void 0?void 0:_b.disconnect()};this.handleInitializeWrapperEvents=function(wrapper){var passive=makePassiveEventOption();wrapper.addEventListener("wheel",_this.onWheelZoom,passive);wrapper.addEventListener("dblclick",_this.onDoubleClick,passive);wrapper.addEventListener("touchstart",_this.onTouchPanningStart,passive);wrapper.addEventListener("touchmove",_this.onTouchPanning,passive);wrapper.addEventListener("touchend",_this.onTouchPanningStop,passive)};this.handleInitialize=function(contentComponent){var centerOnInit=_this.setup.centerOnInit;_this.applyTransformation();if(centerOnInit){_this.setCenter();_this.observer=new ResizeObserver((function(){var _a;_this.setCenter();(_a=_this.observer)===null||_a===void 0?void 0:_a.disconnect()}));_this.observer.observe(contentComponent)}};this.onWheelZoom=function(event){var disabled=_this.setup.disabled;if(disabled)return;var isAllowed=isWheelAllowed(_this,event);if(!isAllowed)return;var keysPressed=_this.isPressingKeys(_this.setup.wheel.activationKeys);if(!keysPressed)return;handleWheelStart(_this,event);handleWheelZoom(_this,event);handleWheelStop(_this,event)};this.onPanningStart=function(event){var disabled=_this.setup.disabled;var onPanningStart=_this.props.onPanningStart;if(disabled)return;var isAllowed=isPanningStartAllowed(_this,event);if(!isAllowed)return;var keysPressed=_this.isPressingKeys(_this.setup.panning.activationKeys);if(!keysPressed)return;event.preventDefault();event.stopPropagation();handleCancelAnimation(_this);handlePanningStart(_this,event);handleCallback(getContext(_this),event,onPanningStart)};this.onPanning=function(event){var disabled=_this.setup.disabled;var onPanning=_this.props.onPanning;if(disabled)return;var isAllowed=isPanningAllowed(_this);if(!isAllowed)return;var keysPressed=_this.isPressingKeys(_this.setup.panning.activationKeys);if(!keysPressed)return;event.preventDefault();event.stopPropagation();handlePanning(_this,event.clientX,event.clientY);handleCallback(getContext(_this),event,onPanning)};this.onPanningStop=function(event){var onPanningStop=_this.props.onPanningStop;if(_this.isPanning){handlePanningEnd(_this);handleCallback(getContext(_this),event,onPanningStop)}};this.onPinchStart=function(event){var disabled=_this.setup.disabled;var _a=_this.props,onPinchingStart=_a.onPinchingStart,onZoomStart=_a.onZoomStart;if(disabled)return;var isAllowed=isPinchStartAllowed(_this,event);if(!isAllowed)return;handlePinchStart(_this,event);handleCancelAnimation(_this);handleCallback(getContext(_this),event,onPinchingStart);handleCallback(getContext(_this),event,onZoomStart)};this.onPinch=function(event){var disabled=_this.setup.disabled;var _a=_this.props,onPinching=_a.onPinching,onZoom=_a.onZoom;if(disabled)return;var isAllowed=isPinchAllowed(_this);if(!isAllowed)return;event.preventDefault();event.stopPropagation();handlePinchZoom(_this,event);handleCallback(getContext(_this),event,onPinching);handleCallback(getContext(_this),event,onZoom)};this.onPinchStop=function(event){var _a=_this.props,onPinchingStop=_a.onPinchingStop,onZoomStop=_a.onZoomStop;if(_this.pinchStartScale){handlePinchStop(_this);handleCallback(getContext(_this),event,onPinchingStop);handleCallback(getContext(_this),event,onZoomStop)}};this.onTouchPanningStart=function(event){var disabled=_this.setup.disabled;var onPanningStart=_this.props.onPanningStart;if(disabled)return;var isAllowed=isPanningStartAllowed(_this,event);if(!isAllowed)return;var isDoubleTap=_this.lastTouch&&+new Date-_this.lastTouch<200;if(isDoubleTap&&event.touches.length===1){_this.onDoubleClick(event)}else{_this.lastTouch=+new Date;handleCancelAnimation(_this);var touches=event.touches;var isPanningAction=touches.length===1;var isPinchAction=touches.length===2;if(isPanningAction){handleCancelAnimation(_this);handlePanningStart(_this,event);handleCallback(getContext(_this),event,onPanningStart)}if(isPinchAction){_this.onPinchStart(event)}}};this.onTouchPanning=function(event){var disabled=_this.setup.disabled;var onPanning=_this.props.onPanning;if(_this.isPanning&&event.touches.length===1){if(disabled)return;var isAllowed=isPanningAllowed(_this);if(!isAllowed)return;event.preventDefault();event.stopPropagation();var touch=event.touches[0];handlePanning(_this,touch.clientX,touch.clientY);handleCallback(getContext(_this),event,onPanning)}else if(event.touches.length>1){_this.onPinch(event)}};this.onTouchPanningStop=function(event){_this.onPanningStop(event);_this.onPinchStop(event)};this.onDoubleClick=function(event){var disabled=_this.setup.disabled;if(disabled)return;var isAllowed=isDoubleClickAllowed(_this,event);if(!isAllowed)return;handleDoubleClick(_this,event)};this.clearPanning=function(event){if(_this.isPanning){_this.onPanningStop(event)}};this.setKeyPressed=function(e){_this.pressedKeys[e.key]=true};this.setKeyUnPressed=function(e){_this.pressedKeys[e.key]=false};this.isPressingKeys=function(keys){if(!keys.length){return true}return Boolean(keys.find((function(key){return _this.pressedKeys[key]})))};this.setTransformState=function(scale,positionX,positionY){var onTransformed=_this.props.onTransformed;if(!Number.isNaN(scale)&&!Number.isNaN(positionX)&&!Number.isNaN(positionY)){if(scale!==_this.transformState.scale){_this.transformState.previousScale=_this.transformState.scale;_this.transformState.scale=scale}_this.transformState.positionX=positionX;_this.transformState.positionY=positionY;var ctx_1=getContext(_this);_this.onChangeCallbacks.forEach((function(callback){return callback(ctx_1)}));handleCallback(ctx_1,{scale:scale,positionX:positionX,positionY:positionY},onTransformed);_this.applyTransformation()}else{console.error("Detected NaN set state values")}};this.setCenter=function(){if(_this.wrapperComponent&&_this.contentComponent){var targetState=getCenterPosition(_this.transformState.scale,_this.wrapperComponent,_this.contentComponent);_this.setTransformState(targetState.scale,targetState.positionX,targetState.positionY)}};this.handleTransformStyles=function(x,y,scale){if(_this.props.customTransform){return _this.props.customTransform(x,y,scale)}return getTransformStyles(x,y,scale)};this.applyTransformation=function(){if(!_this.mounted||!_this.contentComponent)return;var _a=_this.transformState,scale=_a.scale,positionX=_a.positionX,positionY=_a.positionY;var transform=_this.handleTransformStyles(positionX,positionY,scale);_this.contentComponent.style.transform=transform};this.getContext=function(){return getContext(_this)};this.onChange=function(callback){if(!_this.onChangeCallbacks.has(callback)){_this.onChangeCallbacks.add(callback)}return function(){_this.onChangeCallbacks.delete(callback)}};this.init=function(wrapperComponent,contentComponent){_this.cleanupWindowEvents();_this.wrapperComponent=wrapperComponent;_this.contentComponent=contentComponent;handleCalculateBounds(_this,_this.transformState.scale);_this.handleInitializeWrapperEvents(wrapperComponent);_this.handleInitialize(contentComponent);_this.initializeWindowEvents();_this.isInitialized=true;handleCallback(getContext(_this),void 0,_this.props.onInit)};this.props=props;this.setup=createSetup(this.props);this.transformState=createState(this.props)}return ZoomPanPinch2}();var Context=React__default.createContext(null);var getContent=function(children,ctx){if(typeof children==="function"){return children(ctx)}return children};var TransformWrapper=React__default.forwardRef((function(props,ref){var _a=useState(0),forceUpdate=_a[1];var children=props.children;var instance=useRef(new ZoomPanPinch(props)).current;var content=getContent(props.children,getContext(instance));var handleOnChange=useCallback((function(){if(typeof children==="function"){forceUpdate((function(prev){return prev+1}))}}),[children]);useImperativeHandle(ref,(function(){return getContext(instance)}),[instance]);useEffect((function(){instance.update(props)}),[instance,props]);useEffect((function(){return instance.onChange(handleOnChange)}),[instance,props,handleOnChange]);return React__default.createElement(Context.Provider,{value:instance},content)}));function styleInject(css,ref){if(ref===void 0)ref={};var insertAt=ref.insertAt;if(typeof document==="undefined"){return}var head=document.head||document.getElementsByTagName("head")[0];var style=document.createElement("style");style.type="text/css";if(insertAt==="top"){if(head.firstChild){head.insertBefore(style,head.firstChild)}else{head.appendChild(style)}}else{head.appendChild(style)}if(style.styleSheet){style.styleSheet.cssText=css}else{style.appendChild(document.createTextNode(css))}}var css_248z=".transform-component-module_wrapper__7HFJe {\n position: relative;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: hidden;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n margin: 0;\n padding: 0;\n}\n.transform-component-module_content__uCDPE {\n display: flex;\n flex-wrap: wrap;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n margin: 0;\n padding: 0;\n transform-origin: 0% 0%;\n}\n.transform-component-module_content__uCDPE img {\n pointer-events: none;\n}\n";var styles={wrapper:"transform-component-module_wrapper__7HFJe",content:"transform-component-module_content__uCDPE"};styleInject(css_248z);var TransformComponent=function(_a){var children=_a.children,_b=_a.wrapperClass,wrapperClass=_b===void 0?"":_b,_c=_a.contentClass,contentClass=_c===void 0?"":_c,wrapperStyle=_a.wrapperStyle,contentStyle=_a.contentStyle,_d=_a.wrapperProps,wrapperProps=_d===void 0?{}:_d,_e=_a.contentProps,contentProps=_e===void 0?{}:_e;var init=useContext(Context).init;var wrapperRef=useRef(null);var contentRef=useRef(null);useEffect((function(){var wrapper=wrapperRef.current;var content=contentRef.current;if(wrapper!==null&&content!==null&&init){init(wrapper,content)}}),[]);return React__default.createElement("div",__assign({},wrapperProps,{ref:wrapperRef,className:"react-transform-wrapper ".concat(styles.wrapper," ").concat(wrapperClass),style:wrapperStyle}),React__default.createElement("div",__assign({},contentProps,{ref:contentRef,className:"react-transform-component ".concat(styles.content," ").concat(contentClass),style:contentStyle}),children))};React__default.forwardRef((function(props,ref){var localRef=useRef(null);var instance=useContext(Context);useEffect((function(){return instance.onChange((function(ctx){if(localRef.current){var positionX=0;var positionY=0;localRef.current.style.transform=instance.handleTransformStyles(positionX,positionY,1/ctx.state.scale)}}))}),[instance]);return React__default.createElement("div",__assign({},props,{ref:mergeRefs([localRef,ref])}))}));function Slide({alt:alt,onClick:onClick=noop$3,onZoom:onZoom=noop$3,url:url,zooming:zooming=false}){const handlePinchingStop=({state:state})=>{const isZooming=state.scale>1;onZoom(isZooming)};return jsx(TransformWrapper,{doubleClick:{mode:"reset"},initialScale:1,onPinchingStop:handlePinchingStop,panning:{disabled:!zooming},children:jsx("button",{className:"Slide",onClick:onClick,onDoubleClick:()=>onZoom(false),tabIndex:-1,children:jsx(TransformComponent,{wrapperClass:"TransformComponent",children:jsx(Image,{alt:alt,url:url,zIndex:3})})})})}function Slides({urls:urls=[],current:current=0,onChange:onChange=noop$3,setIndex:setIndex}){const[zooming,setZooming]=useState(false);const[touchStart,setTouchStart]=useState(null);const[touchEnd,setTouchEnd]=useState(null);const minSwipeDistance=40;const onTouchStart=e=>{setTouchEnd(null);setTouchStart(e.targetTouches[0].clientX)};const onTouchMove=e=>setTouchEnd(e.targetTouches[0].clientX);const onTouchEnd=()=>{if(!touchStart||!touchEnd)return;const distance=touchStart-touchEnd;const isLeftSwipe=distance>minSwipeDistance;const isRightSwipe=distance<-minSwipeDistance;if(isLeftSwipe){setIndex(current<urls.length-1?current+1:urls.length-1)}else if(isRightSwipe){setIndex(current>0?current-1:0)}};const arrowLeft=()=>setIndex(current>0?current-1:0);const arrowRight=()=>setIndex(current<urls.length-1?current+1:urls.length-1);const handleZoom=isZooming=>setZooming(isZooming);return jsxs("div",{className:"Slides",onTouchEnd:onTouchEnd,onTouchMove:onTouchMove,onTouchStart:onTouchStart,children:[urls.length>1&&jsx(CircleIconButton,{className:"carousel-arrow-left",dark:true,icon:"chevron-left",onClick:arrowLeft,variant:"link"}),jsx(Slide,{onClick:()=>onChange(current),onZoom:handleZoom,url:urls[current],zooming:zooming}),urls.length>1&&jsx(CircleIconButton,{className:"carousel-arrow-right",dark:true,icon:"chevron-right",onClick:arrowRight,variant:"link"})]})}const useWindowSize=()=>{const[size,setSize]=useState({width:window.innerWidth,height:window.innerHeight});useEffect((()=>{const handleResize=()=>{setSize({width:window.innerWidth,height:window.innerHeight})};window.addEventListener("resize",handleResize);handleResize();return()=>window.removeEventListener("resize",handleResize)}),[]);return size};function Thumbnail({active:active=false,alt:alt,width:width,url:url,onClick:onClick,buttonRef:buttonRef}){const activeClasses=classnames("Thumbnail",{active:active});return jsx("button",{className:classnames(activeClasses),onClick:onClick,ref:buttonRef,style:{width:width},type:"button",children:jsx(Image,{alt:alt,size:"sm",url:url})})}function Thumbnails({current:current=0,onChange:onChange=noop$3,urls:urls=[]}){const viewportSize=useWindowSize();const thumbnailWidth=viewportSize.width/8;const shouldBeCentered=thumbnailWidth*urls.length<viewportSize.width*.9;const css=classnames("Thumbnails",{centered:shouldBeCentered});const otherProps={};const thumbnailsRef=React__default.createRef();useLayoutEffect((()=>{var _a,_b,_c;if(shouldBeCentered)return;const currentThumbnail=otherProps.buttonRef.current;const thumbWidth=currentThumbnail.clientWidth,scrollLeft=thumbWidth*current,firstThumb=thumbnailsRef.current.querySelector(".Thumbnail:first-child"),lastThumb=thumbnailsRef.current.querySelector(".Thumbnail:last-child");firstThumb.style.marginLeft=`${((_a=thumbnailsRef.current)==null?void 0:_a.clientWidth)/2-thumbWidth/2}px`;lastThumb.style.marginRight=`${((_b=thumbnailsRef.current)==null?void 0:_b.clientWidth)/2-thumbWidth/2}px`;(_c=thumbnailsRef.current)==null?void 0:_c.scrollTo(scrollLeft,0)}));return jsx("div",{className:css,ref:thumbnailsRef,children:urls.map(((url,i)=>{const active=i===current;if(active)otherProps.buttonRef=React__default.createRef();return jsx(Thumbnail,{active:active,alt:i.toString(),onClick:()=>onChange(i),url:url,...otherProps},i)}))})}function Carousel({currentIndex:currentIndex,photos:photos,onClick:onClick,onChange:onChange=()=>void 0,setIndex:setIndex}){useEffect((()=>{document.body.style.overflow="hidden";return()=>{document.body.style.overflow="initial"}}),[]);const handleChange=index=>{onChange(index)};return jsxs("div",{className:"Lightbox",children:[jsx(Slides,{current:currentIndex,onChange:handleChange,onClick:onClick,setIndex:setIndex,urls:photos.map((photo=>photo.url))}),photos.length>1?jsx(Thumbnails,{current:currentIndex,onChange:handleChange,urls:photos.map((photo=>photo.thumbnail))}):null]})}const Lightbox=props=>{const{aria:aria={},children:children,className:className,currentPhotoIndex:currentPhotoIndex,data:data={},description:description,htmlOptions:htmlOptions={},id:id="",initialPhoto:initialPhoto=0,photos:photos,onChange:onChange=()=>void 0,onClose:onClose,onClickRight:onClickRight,icon:icon="times",navRight:navRight,title:title}=props;const[activePhoto,setActivePhoto]=useState(initialPhoto);useEffect((()=>{onChange(activePhoto)}),[activePhoto]);useEffect((()=>{currentPhotoIndex!==void 0&¤tPhotoIndex!==null&&setActivePhoto(currentPhotoIndex)}),[currentPhotoIndex]);const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_lightbox_kit"),globalProps(props),className);const handleOnSlide=photoIndex=>{setActivePhoto(photoIndex)};const photosMap=useMemo((()=>photos.map((photo=>({url:photo,thumbnail:photo})))),[photos]);const api={onClose:onClose,onArrowLeft:()=>{setActivePhoto(activePhoto>0?activePhoto-1:0)},onArrowRight:()=>{const nextPhoto=activePhoto<photos.length-1?activePhoto+1:photos.length-1;setActivePhoto(nextPhoto)}};useKbdControls(api);const lightboxRef=useRef();return jsx(Fragment$1,{children:jsx(LightboxContext.Provider,{value:api,children:jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,ref:lightboxRef,children:jsxs("div",{className:"carousel",children:[jsx(Lightbox.Header,{icon:icon,navRight:navRight,onClickRight:onClickRight,onClose:onClose,text:description,title:title}),children,jsx(Carousel,{currentIndex:activePhoto,onChange:handleOnSlide,photos:photosMap,setIndex:setActivePhoto})]})})})})};Lightbox.Header=LightboxHeader;const MapCustomButton=({onClick:onClick,icon:icon})=>jsx(Button,{className:"pb_map-custom-button",onClick:onClick,children:jsx(Icon,{icon:icon})});const MapControls=({zoomBtns:zoomBtns,zoomInClick:zoomInClick,zoomOutClick:zoomOutClick,flyTo:flyTo,flyToClick:flyToClick,children:children})=>jsxs(Flex,{className:"custom-nav-control",orientation:"column",children:[zoomBtns?jsxs(Fragment,{children:[jsxs("div",{className:"custom-nav-control-zoom",children:[jsx(Button,{className:"map-zoom-in-button",onClick:zoomInClick,children:jsx(Icon,{icon:"plus"})}),jsx(Button,{className:"map-zoom-out-button",onClick:zoomOutClick,children:jsx(Icon,{icon:"minus"})})]}),flyTo?jsx(Button,{className:"map-flyto-button",onClick:flyToClick,children:jsx(Icon,{icon:"eye"})}):null]}):null,children]});const Map$1=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,zoomBtns:zoomBtns=false,flyTo:flyTo=false,zoomInClick:zoomInClick,zoomOutClick:zoomOutClick,flyToClick:flyToClick}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_map"),globalProps(props),className);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[zoomBtns?jsx(Map$1.Controls,{flyTo:flyTo,flyToClick:flyToClick,zoomBtns:zoomBtns,zoomInClick:zoomInClick,zoomOutClick:zoomOutClick}):null,children]})};Map$1.Controls=MapControls;const Timestamp=props=>{const{align:align="left",aria:aria={},className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},text:text2,timezone:timezone,timestamp:timestamp,showDate:showDate=true,showUser:showUser=false,hideUpdated:hideUpdated=false,showTimezone:showTimezone=false,unstyled:unstyled=false,variant:variant="default"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_timestamp_kit",align,{dark:dark,variant:variant}),globalProps(props),className);const currentYear=(new Date).getFullYear().toString();const dateDisplay=`${DateTime$1.toMonth(timestamp,timezone)} ${DateTime$1.toDay(timestamp,timezone)}`;const shouldShowUser=showUser==true&&text2.length>0;const shouldShowTimezone=showTimezone==true&&timezone.length>0;const updatedText=hideUpdated?"":"Last updated";const userDisplay=shouldShowUser?` by ${text2}`:"";let timeDisplay=`${DateTime$1.toHour(timestamp,timezone)}:${DateTime$1.toMinute(timestamp,timezone)}${DateTime$1.toMeridiem(timestamp,timezone)}`;const fullTimeDisplay=()=>{if(shouldShowTimezone){timeDisplay=`${timeDisplay} ${DateTime$1.toTimeZone(timestamp,timezone)}`}return timeDisplay};const fullDateDisplay=()=>{let fullDisplay=`${DateTime$1.toMonth(timestamp,timezone)} ${DateTime$1.toDay(timestamp,timezone)}`;if(DateTime$1.toYear(timestamp,timezone).toString()!==currentYear){fullDisplay=`${fullDisplay}, ${DateTime$1.toYear(timestamp,timezone)}`}return`${fullDisplay} ${" · "} ${fullTimeDisplay()}`};const formatUpdatedString=()=>`Last updated ${userDisplay} on ${dateDisplay} at ${timeDisplay}`;const formatElapsedString=()=>`${updatedText} ${userDisplay} ${DateTime$1.fromNow(timestamp)}`;const timestampText=()=>{switch(variant){case"updated":return formatUpdatedString();case"elapsed":return formatElapsedString();default:return showDate?timestamp?fullDateDisplay():text2:fullTimeDisplay()}};return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,children:jsx("div",{className:"pb_timestamp_kit",children:unstyled?jsx("div",{children:timestampText()}):jsx(Caption,{dark:dark,size:"xs",text:timestampText()})})})};const MessageMention=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,variant:variant="user"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_message_mention",variant),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children})};const Message=props=>{const{aria:aria={},avatarName:avatarName,avatarStatus:avatarStatus=null,avatarUrl:avatarUrl,children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,label:label,message:message,timestamp:timestamp,timestampObject:timestampObject,timezone:timezone,alignTimestamp:alignTimestamp="right"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const shouldDisplayAvatar=avatarUrl||avatarName;const baseClassName=shouldDisplayAvatar?"pb_message_kit_avatar":"pb_message_kit";const classes=classnames(buildCss(baseClassName),globalProps(props),className);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[shouldDisplayAvatar&&jsx(Avatar,{imageUrl:avatarUrl,name:avatarName,size:"xs",status:avatarStatus}),jsxs("div",{className:"content_wrapper",children:[jsxs(Flex,{justify:alignTimestamp==="left"?"none":"between",orientation:"row",children:[label&&jsx(Title,{className:"message_title",size:4,text:label}),jsx(Timestamp,{className:`pull-${alignTimestamp} ${timestampObject?"message_humanized_time":null}`,text:timestamp,timestamp:"",timezone:timezone}),timestampObject&&jsx(Timestamp,{className:`pull-${alignTimestamp} message_timestamp`,text:"",timestamp:timestampObject,timezone:timezone})]}),message&&jsx(Body$1,{className:"pb_message_body",text:message}),children]})]})};Message.Mention=MessageMention;const MultipleUsers=props=>{const{aria:aria={},className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},id:id,maxDisplayedUsers:maxDisplayedUsers=4,reverse:reverse=false,size:size="xs",users:users}=props;const displayCount=users.length>maxDisplayedUsers?maxDisplayedUsers-1:users.length;const usersToDisplay=users.slice(0,displayCount);const reverseClass=reverse===true?"reverse":"";const avatarSizeClass=size==="xxs"?"xxs":"xs";const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_multiple_users_kit",reverseClass),globalProps(props),className);const itemClasses=classnames("pb_multiple_users_item",buildCss("multiple_users_badge",avatarSizeClass));return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[usersToDisplay.map(((avatarData,index)=>createElement(Avatar,{...avatarData,className:"pb_multiple_users_item",dark:dark,imageAlt:avatarData.name,key:index,size:size}))),users.length>maxDisplayedUsers&&jsx("div",{className:itemClasses,children:`+${users.length-3}`})]})};const MultipleUsersStacked=props=>{const{aria:aria={},className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},id:id,users:users}=props;const moreThanTwo=users.length>2;const onlyOne=users.length==1;const displayCount=()=>moreThanTwo?1:users.length;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_multiple_users_stacked_kit",{single:onlyOne}),globalProps(props),className);const firstUser=()=>users.slice(0,1).map(((userObject,index)=>createElement(Avatar,{...userObject,className:"pb_multiple_users_stacked_item",dark:dark,key:index,size:"xs"})));const secondUser=()=>{if(moreThanTwo===false){return users.slice(1,2).map(((userObject,index)=>createElement(Avatar,{...userObject,className:"pb_multiple_users_stacked_item second_item",dark:dark,key:index,size:"xs"})))}};const plusUsers=()=>{if(moreThanTwo===true){return jsx(Badge,{className:"pb_multiple_users_stacked_item second_item",dark:dark,rounded:true,text:`+${users.length-displayCount()}`,variant:"primary"})}};return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[firstUser(),secondUser(),plusUsers()]})};const previousOverlayDirectionMap$1={bottom:"to top",top:"to bottom",left:"to right",right:"to left",x:"to right",y:"to top"};const subsequentOverlayDirectionMap$1={...previousOverlayDirectionMap$1,x:"to left",y:"to bottom"};const OverlayPercentage=props=>{const{children:children,color:color,position:position,size:size}=props;const getPreviousOverlayDirection=()=>previousOverlayDirectionMap$1[position];const getSubsequentOverlayDirection=()=>subsequentOverlayDirectionMap$1[position];const hasSubsequentOverlay=position==="x"||position==="y";const previousOverlay=`linear-gradient(${getPreviousOverlayDirection()}, ${colors[color]} 0%, transparent ${size})`;const subsequentOverlay=`linear-gradient(${getSubsequentOverlayDirection()}, ${colors[color]} 0%, transparent ${size})`;return jsxs(Fragment,{children:[jsx("div",{className:"overlay_linear_gradient",style:{background:previousOverlay}}),children,hasSubsequentOverlay&&jsx("div",{className:"overlay_linear_gradient",style:{background:subsequentOverlay}})]})};const previousOverlayDirectionMap={x:"left",y:"top"};const subsequentOverlayDirectionMap={x:"right",y:"bottom"};const OverlayToken=props=>{const{children:children,color:color,position:position,size:size}=props;const hasSubsequentOverlay=position==="x"||position==="y";const getPreviousOverlayDirection=()=>hasSubsequentOverlay?previousOverlayDirectionMap[position]:position;const getSubsequentOverlayDirection=()=>hasSubsequentOverlay?subsequentOverlayDirectionMap[position]:position;const previousOverlayClassName=`overlay_${color}_${getPreviousOverlayDirection()}_${size}`;const subsequentOverlayClassName=`overlay_${color}_${getSubsequentOverlayDirection()}_${size}`;return jsxs(Fragment,{children:[jsx("div",{className:previousOverlayClassName}),children,hasSubsequentOverlay&&jsx("div",{className:subsequentOverlayClassName})]})};const Overlay=props=>{const{aria:aria={},className:className,children:children,color:color="card_light",data:data={},htmlOptions:htmlOptions={},id:id,layout:layout={bottom:"full"}}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const classes=classnames(buildCss("pb_overlay"),globalProps(props),className);const htmlProps=buildHtmlProps(htmlOptions);const getPosition=()=>Object.keys(layout)[0];const getSize2=()=>Object.values(layout)[0];const isSizePercentage=getSize2().includes("%");return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:isSizePercentage?OverlayPercentage({children:children,color:color,position:getPosition(),size:getSize2()}):OverlayToken({children:children,color:color,position:getPosition(),size:getSize2()})})};const Person=props=>{const{aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},firstName:firstName,id:id,lastName:lastName}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_person_kit"),globalProps(props),className);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[jsx(Body$1,{className:"pb_person_first",tag:"span",children:firstName}),lastName&&jsx(Title,{className:"pb_person_first",size:4,text:` ${lastName}`})]})};const PersonContact=props=>{const{aria:aria={},className:className,contacts:contacts=[],data:data={},firstName:firstName,htmlOptions:htmlOptions={},id:id,lastName:lastName}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_person_contact_kit"),globalProps(props),className);const wrongContacts=()=>contacts.filter((contactObject=>contactObject.contactType==="wrong-phone"));const validContacts=()=>contacts.filter((contactObject=>contactObject.contactType!=="wrong-phone"));return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[jsx(Person,{firstName:firstName,lastName:lastName}),validContacts().map(((contactObject,index)=>jsx(Contact,{contactDetail:contactObject.contactDetail,contactType:contactObject.contactType,contactValue:contactObject.contactValue},`valid-contact-${index}`))),wrongContacts().map(((contactObject,index)=>jsxs("div",{children:[jsx(Caption,{className:"wrong_numbers",text:"wrong number"},`wrong-contact-caption-${index}`),jsx(Contact,{contactType:contactObject.contactType,contactValue:contactObject.contactValue},`wrong-contact-${index}`)]},`wrong-contact-caption-wrapper-${index}`)))]})};const ProgressPill=({active:active,dark:dark,steps:step})=>jsx("div",{className:`pb_progress_pill${step<=active?"_active":"_inactive"}${dark?" dark":""}`},step);const showSteps=(steps,active,dark)=>{const items=[];for(let step=1;step<=steps;step++){items.push(ProgressPill({steps:step,active:active,dark:dark}))}return items};const ProgressPills=props=>{const{active:active=0,aria:aria={hidden:"true"},className:className,data:data={},htmlOptions:htmlOptions={},id:id,steps:steps=3,title:title,value:value,dark:dark=false}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_progress_pills_kit"),globalProps(props),className);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[title&&jsxs("div",{className:"progress_pills_status",children:[jsx(Title,{dark:dark,size:4,tag:"h4",text:title}),jsx(Body$1,{color:"light",dark:dark,text:value})]}),jsx("div",{className:"progress_pills",children:showSteps(steps,active,dark)})]})};const ProgressSimple=props=>{const{align:align,className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},max:max2,muted:muted=false,percent:percent="",value:value,variant:variant="default",width:width="100%"}=props;const styles2={width:width};const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const variantStyle=variant=="default"?"":variant;const valueStyles={width:percent?`${percent}%`:`${value*100/max2}%`};const wrapperClass=classnames(buildCss("pb_progress_simple_wrapper",align,{dark:dark}),globalProps(props),className);const kitClass=classnames(buildCss("pb_progress_simple_kit",{muted:muted},variantStyle,align),className);return jsx("div",{...dataProps,...htmlProps,className:wrapperClass,children:jsx("div",{className:kitClass,"data-value":value,style:styles2,children:jsx("div",{className:"progress_simple_value",style:valueStyles})})})};const ProgressStep=props=>{const{aria:aria={},className:className,children:children,color:color,data:data={},orientation:orientation="horizontal",htmlOptions:htmlOptions={},icon:icon=false,showIcon:showIcon=false,variant:variant}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const iconStyle=icon===true||showIcon===true?"icon":"";const progressStepCss=buildCss("pb_progress_step_kit",orientation,iconStyle,variant,color);return jsx("ul",{...ariaProps,...dataProps,...htmlProps,className:classnames(progressStepCss,globalProps(props),className),children:children})};const ProgressStepItem=props=>{const{className:className,data:data={},status:status="inactive",children:children,htmlOptions:htmlOptions={},icon:icon="check"}=props;const progressStepItem=buildCss("pb_progress_step_item",status);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsx("li",{...dataProps,...htmlProps,className:classnames(progressStepItem,className),children:jsxs("div",{className:"box",children:[jsx("div",{className:"circle",children:jsx(Icon,{icon:icon})}),jsx("div",{className:"content",children:children})]})})};const createOptions=options=>options.map(((option,index)=>jsx("option",{disabled:option.disabled,value:option.value,children:option.text||option.value},index)));const Select=({aria:aria={},blankSelection:blankSelection,children:children,className:className,compact:compact=false,data:data={},disabled:disabled=false,error:error,label:label,htmlOptions:htmlOptions={},inline:inline=false,multiple:multiple=false,name:name,onChange:onChange=()=>void 0,options:options=[],required:required=false,showArrow:showArrow=false,value:value,...props},ref)=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const optionsList=createOptions(options);const inlineClass=inline?"inline":null;const compactClass=compact?"compact":null;const classes=classnames(buildCss("pb_select"),globalProps({...props,marginBottom:props.marginBottom||props.margin||"sm"}),className,inlineClass,{show_arrow:showArrow},compactClass);const selectWrapperClass=classnames(buildCss("pb_select_kit_wrapper"),{error:error},className);const selectBody=(()=>{if(children)return children;return jsxs("select",{...htmlOptions,...domSafeProps(props),disabled:disabled,id:name,multiple:multiple,name:name,onChange:onChange,ref:ref,required:required,value:value,children:[blankSelection&&jsx("option",{value:"",children:blankSelection}),optionsList]})})();return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,children:[label&&jsx("label",{className:"pb_select_kit_label",htmlFor:name,children:jsx(Caption,{text:label})}),jsxs("label",{className:selectWrapperClass,htmlFor:name,children:[selectBody,multiple!==true?jsx(Icon,{className:"pb_select_kit_caret",fixedWidth:true,icon:"angle-down"}):null,error&&jsx(Body$1,{status:"negative",text:error})]})]})};const Select$1=forwardRef(Select);const SelectableCard=props=>{const{aria:aria={},checked:checked=false,className:className,customIcon:customIcon,dark:dark=false,data:data={},disabled:disabled=false,error:error=false,htmlOptions:htmlOptions={},icon:icon=false,inputId:inputId=null,multi:multi=true,name:name,onChange:onChange=noop$2,text:text2,value:value,variant:variant="default"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_selectable_card_kit",{checked:checked,disabled:disabled,enabled:!disabled}),{error:error},dark?"dark":"",className);const displayIcon2=()=>{if(icon===true){return jsx("div",{className:"pb_selectable_card_circle",children:jsx(Icon,{customIcon:customIcon,fixedWidth:true,icon:"check"})})}};const inputRef=useRef(null);const handleClick=()=>{inputRef.current.click()};const inputType=multi?"checkbox":"radio";const inputIdPresent=inputId!==null?inputId:name;const Input=multi?Checkbox:Radio;const filteredProps={...props};filteredProps==null?true:delete filteredProps.inputId;filteredProps==null?true:delete filteredProps.children;filteredProps==null?true:delete filteredProps.icon;filteredProps==null?true:delete filteredProps.error;filteredProps==null?true:delete filteredProps.dark;filteredProps==null?true:delete filteredProps.multi;filteredProps==null?true:delete filteredProps.customIcon;const labelProps=variant==="displayInput"?{...filteredProps,padding:"none"}:{...filteredProps};return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,children:[jsx("input",{checked:checked,disabled:disabled,id:inputIdPresent,name:name,onChange:onChange,ref:inputRef,type:inputType,value:value,...filteredProps}),jsxs("label",{className:globalProps(labelProps),htmlFor:inputIdPresent,children:[variant==="displayInput"?jsxs(Flex,{vertical:"center",children:[jsx(Flex,{orientation:"column",padding:"sm",paddingRight:"xs",vertical:"center",children:jsx(Input,{dark:dark,children:jsx("input",{checked:checked,disabled:disabled,onClick:handleClick,readOnly:true,type:inputType})})}),jsx("div",{className:"separator"}),jsx("div",{className:"psuedo_separator"}),jsx(Card,{borderNone:true,dark:dark,padding:"sm",status:error?"negative":null,children:text2||props.children})]}):text2||props.children,displayIcon2()]})]})};const SelectableIcon=({aria:aria={},className:className,checked:checked=false,customIcon:customIcon,data:data={},disabled:disabled=false,htmlOptions:htmlOptions={},icon:icon,inputId:inputId,inputs:inputs="enabled",multi:multi=true,name:name,text:text2,value:value,...props})=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_selectable_icon_kit",{checked:checked,disabled:disabled,enabled:!disabled}),globalProps(props),className);const inputType=multi===false?"radio":"checkbox";const inputIdPresent=inputId!==null?inputId:name;return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,children:[inputs==="disabled"&&jsxs(Fragment,{children:[jsx(Icon,{customIcon:customIcon,icon:icon,size:"2x"}),jsx(Title,{size:4,tag:"h4",text:text2})]}),inputs==="enabled"&&jsxs(Fragment,{children:[jsx("input",{...props,checked:checked,disabled:disabled,id:inputIdPresent,name:name,type:inputType,value:value}),jsxs("label",{htmlFor:inputIdPresent,children:[jsx(Icon,{customIcon:customIcon,icon:icon,size:"2x"}),jsx(Title,{size:4,tag:"h4",text:text2})]})]})]})};const SelectableCardIcon=props=>{const{aria:aria={},checkmark:checkmark=false,checked:checked=false,className:className,customIcon:customIcon,dark:dark=false,data:data={},disabled:disabled=false,htmlOptions:htmlOptions={},icon:icon,inputId:inputId,multi:multi=true,name:name,titleText:titleText,bodyText:bodyText,value:value,onChange:onChange}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_selectable_card_icon_kit",{checked:checked,disabled:disabled,enabled:!disabled}),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,children:jsx(SelectableCard,{checked:checked,customIcon:customIcon,dark:dark,disabled:disabled,icon:checkmark,inputId:inputId,multi:multi,name:name,onChange:onChange,value:value,children:jsxs(Fragment,{children:[jsx(SelectableIcon,{customIcon:customIcon,icon:icon,inputId:"",inputs:"disabled",name:"",text:titleText}),jsx(Body$1,{color:"light",dark:dark,text:bodyText})]})})})};const SelectableListItem=({aria:aria={},checked:checked=false,children:children,className:className,data:data={},dragId:dragId,dragHandle:dragHandle=true,defaultChecked:defaultChecked,htmlOptions:htmlOptions={},id:id,label:label,text:text2="",name:name="",value:value="",variant:variant="checkbox",onChange:onChange=()=>{},...props})=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_selectable_list_item_kit"),globalProps(props),className);const initialCheckedState=checked;const[checkedState,setCheckedState]=useState(initialCheckedState);const handleChecked=event=>{onChange(event);setCheckedState(event.target.checked)};return jsx(ListItem,{...props,className:classnames(checkedState?"checked_item":"",className),dragHandle:dragHandle,dragId:dragId,children:jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,children:[variant=="checkbox"&&jsxs(Fragment,{children:[jsx(Checkbox,{checked:checkedState,id:id,name:name,onChange:handleChecked,text:label||text2&&false,type:"checkbox",value:value,...props}),children]}),variant=="radio"&&jsxs(Fragment,{children:[jsx(Radio,{defaultChecked:defaultChecked,id:id,label:label,name:name,onChange:onChange,text:label,type:"radio",value:value,...domSafeProps(props)}),children]}),variant!=="checkbox"&&variant!=="radio"&&{children:children}]})})};const SelectableList=props=>{var _a,_b;const{aria:aria={},children:children,className:className,data:data={},enableDrag:enableDrag=false,htmlOptions:htmlOptions={},id:id}=props;const ariaProps=buildAriaProps(aria);const classes=classnames(buildCss("pb_selectable_list_kit"),globalProps(props),className);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const isRadio=props.variant==="radio";const defaultCheckedRadioValue=(_b=(_a=children.filter((item=>item.props.defaultChecked))[0])==null?void 0:_a.props)==null?void 0:_b.value;const[selectedRadioValue,setSelectedRadioValue]=useState(defaultCheckedRadioValue);const onChangeRadioValue=({target:target})=>{setSelectedRadioValue(target.value)};let selectableListItems=children;if(isRadio){selectableListItems=children.map((({props:props2})=>createElement(SelectableListItem,{...props2,className:classnames(selectedRadioValue===props2.value?"checked_item":"",props2.className),key:props2.value,onChange:evt=>{var _a2;onChangeRadioValue(evt);(_a2=props2==null?void 0:props2.onChange)==null?void 0:_a2.call(props2,evt)}})))}return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsx(List,{enableDrag:enableDrag,variant:props.variant,children:selectableListItems})})};SelectableList.Item=SelectableListItem;const Source=({aria:aria={},className:className,data:data={},hideIcon:hideIcon=false,htmlOptions:htmlOptions={},id:id,source:source,type:type="inbound",user:user={}})=>{const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const ariaProps=buildAriaProps(aria);const css=classnames(["pb_source_kit",className]);const avatar=()=>{if((type==="user"||type==="referral")&&user.name!==void 0){const avatarProps={...user};avatarProps.size="sm";delete avatarProps.userId;return avatarProps}};const typeText=()=>{if(type==="user"||type==="referral"&&user.name!==void 0){return user.name}else{return titleize(type)}};const typeIconNames={events:"calendar-alt",outbound:"sign-out",prospecting:"binoculars",referral:"handshake",retail:"shopping-bag",inbound:"sign-in"};const showIcon=()=>type!=="user"&&avatar()===void 0;return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:css,id:id,children:jsxs("div",{className:"pb__source_layout",children:[hideIcon===false&&jsxs(Fragment,{children:[showIcon()&&jsx(IconCircle,{icon:typeIconNames[type],size:"sm"}),!showIcon()&&jsx(Avatar,{...avatar()})]}),jsxs("div",{className:"pb__source_content",children:[jsx(Title,{size:4,tag:"h4",text:source}),jsxs("div",{className:"pb__source_value",children:[jsx(Body$1,{color:"light",text:typeText()}),user.userId&&jsx(Caption,{text:user.userId})]})]})]})})};const starYellow=jsx("svg",{className:"iamyellow",fill:"none",viewBox:"0 0 18 16",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{clipRule:"evenodd",d:"M9.86015 0.4371C9.73527 0.187329 9.4855 0 9.17328 0C8.89229 0 8.64252 0.187329 8.51763 0.4371L6.36335 4.83932L1.58647 5.55742C1.30547 5.58864 1.08692 5.80719 0.99326 6.05696C0.899595 6.33795 0.962038 6.61895 1.18059 6.8375L4.64617 10.2719L3.80319 15.1112C3.77197 15.3922 3.89685 15.7044 4.11541 15.8605C4.36518 16.0166 4.64617 16.0478 4.89594 15.9229L9.17328 13.6126L13.4506 15.9229C13.7004 16.0478 14.0126 16.0166 14.2624 15.8605C14.4809 15.7044 14.6058 15.3922 14.5434 15.1112L13.7316 10.2719L17.1972 6.8375C17.4157 6.61895 17.4782 6.33795 17.3845 6.05696C17.2909 5.80719 17.0723 5.58864 16.7913 5.55742L12.0144 4.83932L9.86015 0.4371Z",fill:"#F9BB00",fillRule:"evenodd"})});const starPrimary=jsx("svg",{fill:"none",viewBox:"0 0 18 16",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{clipRule:"evenodd",d:"M9.86015 0.4371C9.73527 0.187329 9.4855 0 9.17328 0C8.89229 0 8.64252 0.187329 8.51763 0.4371L6.36335 4.83932L1.58647 5.55742C1.30547 5.58864 1.08692 5.80719 0.99326 6.05696C0.899595 6.33795 0.962038 6.61895 1.18059 6.8375L4.64617 10.2719L3.80319 15.1112C3.77197 15.3922 3.89685 15.7044 4.11541 15.8605C4.36518 16.0166 4.64617 16.0478 4.89594 15.9229L9.17328 13.6126L13.4506 15.9229C13.7004 16.0478 14.0126 16.0166 14.2624 15.8605C14.4809 15.7044 14.6058 15.3922 14.5434 15.1112L13.7316 10.2719L17.1972 6.8375C17.4157 6.61895 17.4782 6.33795 17.3845 6.05696C17.2909 5.80719 17.0723 5.58864 16.7913 5.55742L12.0144 4.83932L9.86015 0.4371Z",fill:"#0056CF",fillRule:"evenodd"})});const starSubtle=jsx("svg",{fill:"none",viewBox:"0 0 18 16",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{clipRule:"evenodd",d:"M8.90904 0.4371C8.78416 0.187329 8.53438 0 8.22217 0C7.94118 0 7.69141 0.187329 7.56652 0.4371L5.41224 4.83932L0.635357 5.55742C0.354364 5.58864 0.135813 5.80719 0.042149 6.05696C-0.0515154 6.33795 0.0109275 6.61895 0.229478 6.8375L3.69506 10.2719L2.85208 15.1112C2.82086 15.3922 2.94574 15.7044 3.16429 15.8605C3.41407 16.0166 3.69506 16.0478 3.94483 15.9229L8.22217 13.6126L12.4995 15.9229C12.7493 16.0478 13.0615 16.0166 13.3113 15.8605C13.5298 15.7044 13.6547 15.3922 13.5923 15.1112L12.7805 10.2719L16.2461 6.8375C16.4646 6.61895 16.5271 6.33795 16.4334 6.05696C16.3397 5.80719 16.1212 5.58864 15.8402 5.55742L11.0633 4.83932L8.90904 0.4371Z",fillRule:"evenodd"})});const starOutline=jsx("svg",{fill:"none",height:"16",viewBox:"0 0 17 16",width:"17",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M5.91323 5.33377L6.17269 5.29477L6.28801 5.0591L8.44116 0.659187C8.49971 0.543364 8.59517 0.5 8.64884 0.5C8.74499 0.5 8.83506 0.555009 8.88775 0.659235L11.0409 5.0591L11.1562 5.29477L11.4157 5.33377L16.1925 6.05186L16.2021 6.0533L16.2117 6.05436C16.2359 6.05706 16.2671 6.06847 16.3024 6.09973C16.3374 6.13062 16.3686 6.17476 16.3886 6.22412C16.4186 6.32162 16.401 6.40181 16.3198 6.48332C16.3196 6.48353 16.3194 6.48374 16.3192 6.48395L12.8552 9.91671L12.6712 10.0991L12.7141 10.3546L13.5258 15.1939L13.528 15.2068L13.5308 15.2196C13.5488 15.3004 13.5074 15.402 13.4567 15.4462C13.3391 15.5132 13.2227 15.5096 13.1546 15.4781L8.88646 13.1726L8.64884 13.0443L8.41121 13.1726L4.14274 15.4782C4.07877 15.5083 3.99031 15.5147 3.87267 15.4466C3.82302 15.4033 3.76655 15.2914 3.77463 15.1781L4.61431 10.3577L4.65911 10.1005L4.47368 9.91671L1.0097 6.48394C1.00947 6.48372 1.00925 6.4835 1.00903 6.48327C0.927878 6.40178 0.91031 6.3216 0.94026 6.22412C0.960274 6.17476 0.99154 6.13062 1.02646 6.09973C1.0618 6.06847 1.09296 6.05706 1.11724 6.05436L1.12682 6.0533L1.13635 6.05186L5.91323 5.33377Z",stroke:"#C1CDD6"})});const getStarIconObject=(backgroundType,color,dark,size)=>{const colorClassName=color==="subtle"?dark?"suble_star_dark":"suble_star_light":`${color}_star`;const backgroundClassName=backgroundType==="outline"?dark?"outline_empty_star_dark":"outline_empty_star_light":dark?"empty_star_dark":"empty_star_light";return{yellow:{className:`pb_star_${size} ${colorClassName}`,icon:starYellow},primary:{className:`pb_star_${size} ${colorClassName}`,icon:starPrimary},subtle:{className:`pb_star_${size} ${colorClassName}`,icon:starSubtle},fill:{className:`pb_star_${size} ${backgroundClassName}`,icon:starYellow},outline:{className:`pb_star_${size} ${backgroundClassName}`,icon:starOutline}}};const StarRatingInteractive=props=>{const{backgroundType:backgroundType,colorOption:colorOption,dark:dark,denominator:denominator,onClick:onClick,size:size}=props;const[interactiveStarValue,setInteractiveStarValue]=useState(0);const starIcon=getStarIconObject(backgroundType,colorOption,dark,size);const handleOnClick=interactiveStarValue2=>{setInteractiveStarValue(interactiveStarValue2);onClick&&onClick(interactiveStarValue2)};return jsx(Flex,{className:"star_flex_area",children:[...Array(denominator)].map(((_,index)=>jsxs(React__default.Fragment,{children:[index+1<=interactiveStarValue&&jsx(Icon,{className:starIcon[colorOption].className,cursor:"pointer",customIcon:starIcon[colorOption].icon,htmlOptions:{onClick:()=>handleOnClick(index+1)},icon:""}),index+1>interactiveStarValue&&jsx(React__default.Fragment,{children:jsx(Icon,{className:starIcon[backgroundType].className,cursor:"pointer",customIcon:starIcon[backgroundType].icon,htmlOptions:{onClick:()=>handleOnClick(index+1)},icon:""})},index)]},index)))})};const StarRatingDisplay=props=>{const{backgroundType:backgroundType,colorOption:colorOption,dark:dark,denominator:denominator,layoutOption:layoutOption,rating:rating,size:size}=props;const denominatorStyle=layoutOption==="onestar"?1:denominator;const activeStars=Math.round(rating)>denominatorStyle?denominatorStyle:Math.round(rating);const emptyStars=denominatorStyle-Math.round(rating)<0?0:denominatorStyle-Math.round(rating);const starIcon=getStarIconObject(backgroundType,colorOption,dark,size);return jsxs(Flex,{className:"star_flex_area",children:[[...Array(activeStars)].map(((_,index)=>jsx(React__default.Fragment,{children:jsx(Icon,{className:starIcon[colorOption].className,customIcon:starIcon[colorOption].icon,icon:""})},index))),[...Array(emptyStars)].map(((_,index)=>jsx(React__default.Fragment,{children:jsx(Icon,{className:starIcon[backgroundType].className,customIcon:starIcon[backgroundType].icon,icon:""})},index)))]})};const StarRating=props=>{const{aria:aria={},className:className,data:data={},dark:dark=false,layoutOption:layoutOption="default",htmlOptions:htmlOptions={},id:id,rating:rating=0,denominator:denominator=5,colorOption:colorOption="yellow",backgroundType:backgroundType="fill",size:size="sm",variant:variant="display",onClick:onClick}=props;const classes=classnames(buildCss("pb_star_rating_kit"),globalProps(props),className);const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const oneDecimalRating=rating.toFixed(1);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[layoutOption==="number"&&jsxs(Fragment,{children:[(size==="xs"||size==="sm")&&jsx(Caption,{className:"pb_star_rating_number_sm",dark:dark,paddingRight:"xs",size:"xs",text:oneDecimalRating.toString()}),size==="md"&&jsx(Body$1,{className:"pb_star_rating_number_md",color:"light",dark:dark,paddingRight:"xs",text:oneDecimalRating.toString()}),size==="lg"&&jsx(Title,{bold:false,className:"pb_star_rating_number_lg",color:"light",dark:dark,paddingRight:"sm",size:2,text:oneDecimalRating.toString()})]}),variant==="display"&&jsx(StarRatingDisplay,{backgroundType:backgroundType,colorOption:colorOption,dark:dark,denominator:denominator,layoutOption:layoutOption,rating:rating,size:size}),variant==="interactive"&&jsx(StarRatingInteractive,{backgroundType:backgroundType,colorOption:colorOption,dark:dark,denominator:denominator,onClick:onClick,size:size}),layoutOption==="onestar"&&jsxs(Fragment,{children:[(size==="xs"||size==="sm")&&jsx(Caption,{className:"pb_star_rating_number_sm",dark:dark,size:"xs",text:`${rating.toString()} of ${denominator}`}),size==="md"&&jsx(Body$1,{className:"pb_star_rating_number_md",color:"light",dark:dark,text:`${rating.toString()} of ${denominator}`}),size==="lg"&&jsx(Title,{bold:false,className:"pb_star_rating_number_lg",color:"light",dark:dark,size:2,text:`${rating.toString()} of ${denominator}`})]})]})};const Textarea=({aria:aria={},characterCount:characterCount,className:className,children:children,data:data={},disabled:disabled,htmlOptions:htmlOptions={},inline:inline=false,resize:resize="none",error:error,label:label,maxCharacters:maxCharacters,name:name,onChange:onChange=()=>{},placeholder:placeholder,required:required,rows:rows=4,value:value,...props})=>{const ref=useRef(null);useEffect((()=>{if(ref.current&&resize==="auto"){PbTextarea.addMatch(ref.current)}}));const errorClass=error?"error":null;const inlineClass=inline?"inline":"";const resizeClass=`resize_${resize}`;const classes=classnames("pb_textarea_kit",errorClass,inlineClass,resizeClass,globalProps(props),className);const noCount=typeof characterCount!=="undefined";const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const checkIfZero=characterCount2=>characterCount2==0?characterCount2.toString():characterCount2;const characterCounter=()=>maxCharacters&&characterCount?`${checkIfZero(characterCount)} / ${maxCharacters}`:`${checkIfZero(characterCount)}`;return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,children:[jsx(Caption,{text:label}),children||jsx("textarea",{className:"pb_textarea_kit",disabled:disabled,name:name,onChange:onChange,placeholder:placeholder,ref:ref,required:required,rows:rows,value:value,...props}),error?jsx(Fragment,{children:characterCount?jsxs(Flex,{spacing:"between",vertical:"center",children:[jsx(FlexItem,{children:jsx(Body$1,{margin:"none",status:"negative",text:error})}),jsx(FlexItem,{children:jsx(Caption,{margin:"none",size:"xs",text:characterCounter()})})]}):jsx(Body$1,{status:"negative",text:error})}):noCount&&jsx(Caption,{margin:"none",size:"xs",text:characterCounter()})]})};const Textarea$1=forwardRef(Textarea);const timezoneString=dateValue=>`${DateTime$1.toTimeZone(dateValue)}`;const dateTimestamp=dateValue=>`${DateTime$1.toHour(dateValue)}:${DateTime$1.toMinute(dateValue)}${DateTime$1.toMeridiem(dateValue)}`;const dateTimeIso=dateValue=>DateTime$1.toIso(dateValue);const TimeRangeInline=props=>{const{aria:aria={},className:className,data:data={},alignment:alignment="left",htmlOptions:htmlOptions={},size:size="sm",dark:dark=false,icon:icon=false,timezone:timezone=false,startTime:startTime,endTime:endTime,id:id}=props;const dataProps=buildDataProps(data);const ariaProps=buildAriaProps(aria);const htmlProps=buildHtmlProps(htmlOptions);const separator=jsx(Body$1,{color:"light",children:jsx(Icon,{className:"pb_time_range_inline_arrow",dark:dark,fixedWidth:true,icon:"long-arrow-right"})});const iconContent=()=>icon&&jsx(Body$1,{color:"light",tag:"span",children:jsx(Icon,{className:"pb_time_range_inline_icon",dark:dark,fixedWidth:true,icon:"clock",size:size,tag:"span"})});return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classnames("pb_time_range_inline_kit_"+alignment,globalProps(props),className),id:id,children:jsxs("div",{className:"pb_time_range_inline_wrapper",children:[size=="xs"&&jsxs(Fragment,{children:[jsxs(Caption,{dark:dark,tag:"span",children:[iconContent(),jsx("time",{dateTime:dateTimeIso(startTime),children:` ${dateTimestamp(startTime)} `})]}),jsx(Caption,{className:"pb_time_range_inline_arrow",dark:dark,tag:"span",children:separator}),jsx(Caption,{dark:dark,tag:"span",children:jsx("time",{dateTime:dateTimeIso(endTime),children:` ${dateTimestamp(endTime)} `})}),timezone&&jsx(Caption,{className:"pb_time_range_inline_timezone",dark:dark,tag:"span",children:timezoneString(endTime)})]}),size=="sm"&&jsxs(Fragment,{children:[jsxs(Body$1,{dark:dark,tag:"span",children:[iconContent(),jsx("time",{dateTime:dateTimeIso(startTime),children:` ${dateTimestamp(startTime)} `})]}),jsx(Body$1,{className:"pb_time_range_inline_arrow",dark:dark,tag:"span",children:separator}),jsx(Body$1,{dark:dark,tag:"span",children:jsx("time",{dateTime:dateTimeIso(endTime),children:` ${dateTimestamp(endTime)} `})}),timezone&&jsx(Body$1,{className:"pb_time_range_inline_timezone",color:"light",dark:dark,tag:"span",children:timezoneString(endTime)})]})]})})};const TimelineItem=({className:className,children:children,date:date,htmlOptions:htmlOptions={},icon:icon="user",iconColor:iconColor="default",lineStyle:lineStyle="solid",...props})=>{const timelineItemCss=buildCss("pb_timeline_item_kit",lineStyle);const htmlProps=buildHtmlProps(htmlOptions);return jsxs("div",{...htmlProps,className:classnames(timelineItemCss,globalProps(props),className),children:[jsx("div",{className:"pb_timeline_item_left_block",children:date&&jsx(DateStacked,{align:"center",date:date,size:"sm"})}),jsxs("div",{className:"pb_timeline_item_step",children:[jsx(IconCircle,{icon:icon,size:"xs",variant:iconColor}),jsx("div",{className:"pb_timeline_item_connector"})]}),jsx("div",{className:"pb_timeline_item_right_block",children:children})]})};const Timeline=({aria:aria={},className:className,children:children,data:data={},htmlOptions:htmlOptions={},id:id,orientation:orientation="horizontal",showDate:showDate=false,...props})=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const dateStyle=showDate===true?"_with_date":"";const timelineCss=buildCss("pb_timeline_kit",`_${orientation}`,dateStyle);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classnames(timelineCss,globalProps(props),className),id:id,children:children})};Timeline.Item=TimelineItem;const TitleDetail=props=>{const{align:align="left",aria:aria={},className:className,data:data={},detail:detail,htmlOptions:htmlOptions={},id:id,title:title}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const pbCss=buildCss("pb_title_detail_kit",align);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classnames(pbCss,globalProps(props),className),id:id,children:[jsx(Title,{size:4,text:title}),jsx(Body$1,{color:"light",text:detail})]})};const Toggle=({aria:aria={},checked:checked=false,children:children,className:className,data:data={},disabled:disabled=false,id:id,htmlOptions:htmlOptions={},name:name,onChange:onChange=()=>{},size:size="sm",value:value,...props})=>{const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const css=classnames(buildCss("pb_toggle_kit",size,{on:checked,off:!checked}));return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classnames(css,globalProps(props),className),id:id,children:jsxs("label",{className:"pb_toggle_wrapper",children:[children&&children,!children&&jsx("input",{...props,defaultChecked:checked,disabled:disabled,name:name,onChange:onChange,type:"checkbox",value:value}),jsx("div",{className:"pb_toggle_control"})]})})};const Veteran=()=>jsxs("svg",{viewBox:"0 0 200 250",xmlSpace:"preserve",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M198.4 71.5V71c-.2-1.2-1.4-2.1-1.4-2.1L103.2 2.7c-.7-.4-1-.6-1.6-.6-1.3 0-2.3 1-2.3 2.3v67.1h-.6v29.6h99.8l-.1-29.6z",fill:"#004876"}),jsx("path",{d:"M172.9 159.2c-31.4 23-33.2 24.3-33.2 24.3l-40.5 3.2v-29.4l73.7 1.9z",fill:"#FFF"}),jsx("path",{d:"M99.3 125.4V33.5L1.6 102.7l-.1.1c-1 .7-1.5 1.8-1.5 3v67.4c0 1.2.6 2.3 1.5 3l.1.1 93.5 66.3c1.7 1.2 4.1 0 4.1-2.1v-28.9l40.5-28-40.5.7v-25h73.7l25.4-16.9.2-16.8H99.3z",fill:"#BB2432"}),jsx("path",{d:"M99.3 101.1h99.3v24.3H99.3z",fill:"#FFF"})]});const MillionDollar=()=>jsxs("svg",{viewBox:"0 0 242.9 242.9",xmlSpace:"preserve",xmlns:"http://www.w3.org/2000/svg",children:[jsx("circle",{cx:121.5,cy:121.5,r:121.5}),jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"a",x1:42.483,x2:200.309,y1:35.645,y2:35.645,children:[jsx("stop",{offset:0,style:{stopColor:"#e6b711"}}),jsx("stop",{offset:.128,style:{stopColor:"#eac23c"}}),jsx("stop",{offset:.278,style:{stopColor:"#ec6"}}),jsx("stop",{offset:.413,style:{stopColor:"#f1d485"}}),jsx("stop",{offset:.527,style:{stopColor:"#f2d998"}}),jsx("stop",{offset:.607,style:{stopColor:"#f3db9f"}}),jsx("stop",{offset:1,style:{stopColor:"#e6b711"}})]}),jsx("path",{d:"M56.4 53.8c16.9-16.2 39.8-26.2 65-26.2 25.2 0 48.1 10 64.9 26.2h14c-19.1-22.2-47.4-36.3-78.9-36.3-31.5 0-59.8 14.1-78.9 36.3h13.9z",style:{fill:"url(#a)"}}),jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"b",x1:17.407,x2:44.897,y1:132.179,y2:132.179,children:[jsx("stop",{offset:0,style:{stopColor:"#e6b711"}}),jsx("stop",{offset:.128,style:{stopColor:"#eac23c"}}),jsx("stop",{offset:.278,style:{stopColor:"#ec6"}}),jsx("stop",{offset:.413,style:{stopColor:"#f1d485"}}),jsx("stop",{offset:.527,style:{stopColor:"#f2d998"}}),jsx("stop",{offset:.607,style:{stopColor:"#f3db9f"}}),jsx("stop",{offset:1,style:{stopColor:"#e6b711"}})]}),jsx("path",{d:"M44.9 175.7c-10.9-15.3-17.3-34-17.3-54.2 0-14.1 3.1-27.5 8.8-39.5H25.3c-5 12.2-7.8 25.5-7.8 39.5 0 22.7 7.3 43.8 19.8 60.9l7.6-6.7z",style:{fill:"url(#b)"}}),jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"c",x1:52.914,x2:189.715,y1:212.573,y2:212.573,children:[jsx("stop",{offset:0,style:{stopColor:"#e6b711"}}),jsx("stop",{offset:.128,style:{stopColor:"#eac23c"}}),jsx("stop",{offset:.278,style:{stopColor:"#ec6"}}),jsx("stop",{offset:.413,style:{stopColor:"#f1d485"}}),jsx("stop",{offset:.527,style:{stopColor:"#f2d998"}}),jsx("stop",{offset:.607,style:{stopColor:"#f3db9f"}}),jsx("stop",{offset:1,style:{stopColor:"#e6b711"}})]}),jsx("path",{d:"M173 199.8c-14.8 9.8-32.5 15.5-51.6 15.5s-37-5.8-51.8-15.6H52.9c18.3 16.1 42.3 25.8 68.5 25.8 26.1 0 50-9.7 68.3-25.7H173z",style:{fill:"url(#c)"}}),jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"d",x1:31.123,x2:207.766,y1:136.159,y2:136.159,children:[jsx("stop",{offset:0,style:{stopColor:"#e6b711"}}),jsx("stop",{offset:.128,style:{stopColor:"#eac23c"}}),jsx("stop",{offset:.278,style:{stopColor:"#ec6"}}),jsx("stop",{offset:.413,style:{stopColor:"#f1d485"}}),jsx("stop",{offset:.527,style:{stopColor:"#f2d998"}}),jsx("stop",{offset:.607,style:{stopColor:"#f3db9f"}}),jsx("stop",{offset:1,style:{stopColor:"#e6b711"}})]}),jsx("path",{d:"M139.2 193v-1.8c5-.4 10.2-.5 13.4-5 3.8-5.2 3.2-15.4 3.2-21.5V78.5l-47.3 120.4L61.2 81.2v61.1c0 13.6.5 35.1 12.5 44.2 4.3 3.2 9 3.9 14.2 4.7v1.8H31.1v-1.8c1.6-.4 3.2-.7 4.8-1.1 22.6-5.7 22.9-32.4 22.9-51.1v-37.8c0-6.1.5-13.3-3.2-18.5-4.5-6.1-13.4-7.2-20.4-7.5v-1.8H96l29.6 75.4 29.9-75.4h52.3v1.8c-4.8.4-10.2.9-13.4 5-3.8 4.8-3.2 15.9-3.2 21.9v62.5c0 6.3-.7 16.1 3.2 21.5 3.2 4.3 6.2 4.7 11.2 5v1.8h-66.4z",style:{fill:"url(#d)"}}),jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"e",x1:30.453,x2:213.794,y1:63.629,y2:63.629,children:[jsx("stop",{offset:0,style:{stopColor:"#e6b711"}}),jsx("stop",{offset:.128,style:{stopColor:"#eac23c"}}),jsx("stop",{offset:.278,style:{stopColor:"#ec6"}}),jsx("stop",{offset:.413,style:{stopColor:"#f1d485"}}),jsx("stop",{offset:.527,style:{stopColor:"#f2d998"}}),jsx("stop",{offset:.607,style:{stopColor:"#f3db9f"}}),jsx("stop",{offset:1,style:{stopColor:"#e6b711"}})]}),jsx("path",{d:"M30.5 60.6h183.3v6.1H30.5z",style:{fill:"url(#e)"}}),jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"f",x1:196.676,x2:225.538,y1:132.923,y2:132.923,children:[jsx("stop",{offset:0,style:{stopColor:"#e6b711"}}),jsx("stop",{offset:.128,style:{stopColor:"#eac23c"}}),jsx("stop",{offset:.278,style:{stopColor:"#ec6"}}),jsx("stop",{offset:.413,style:{stopColor:"#f1d485"}}),jsx("stop",{offset:.527,style:{stopColor:"#f2d998"}}),jsx("stop",{offset:.607,style:{stopColor:"#f3db9f"}}),jsx("stop",{offset:1,style:{stopColor:"#e6b711"}})]}),jsx("path",{d:"M196.7 177.5c11.5-15.6 18.7-35.2 18.7-56 0-14.1-3.1-27.5-8.8-39.5h11.1c5 12.2 7.8 25.5 7.8 39.5 0 23.4-7.8 45-20.9 62.4l-7.9-6.4z",style:{fill:"url(#f)"}})]});const UserBadge=props=>{const{aria:aria={},badge:badge="million-dollar",className:className,data:data={},htmlOptions:htmlOptions={},id:id,size:size="md"}=props;const image=badge==="million-dollar"?jsx(MillionDollar,{}):jsx(Veteran,{});const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_user_badge_kit",size),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsx("div",{className:"pb_user_badge_wrapper",children:image})})};function isOfType$2(type){return function(value){return typeof value===type}}var isFunction$1=isOfType$2("function");var isNull=function(value){return value===null};var isRegex=function(value){return Object.prototype.toString.call(value).slice(8,-1)==="RegExp"};var isObject=function(value){return!isUndefined(value)&&!isNull(value)&&(isFunction$1(value)||typeof value==="object")};var isUndefined=isOfType$2("undefined");var __values=function(o){var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};function equalArray(left,right){var length=left.length;if(length!==right.length){return false}for(var index=length;index--!==0;){if(!equal(left[index],right[index])){return false}}return true}function equalArrayBuffer(left,right){if(left.byteLength!==right.byteLength){return false}var view1=new DataView(left.buffer);var view2=new DataView(right.buffer);var index=left.byteLength;while(index--){if(view1.getUint8(index)!==view2.getUint8(index)){return false}}return true}function equalMap(left,right){var e_1,_a,e_2,_b;if(left.size!==right.size){return false}try{for(var _c=__values(left.entries()),_d=_c.next();!_d.done;_d=_c.next()){var index=_d.value;if(!right.has(index[0])){return false}}}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(_d&&!_d.done&&(_a=_c.return))_a.call(_c)}finally{if(e_1)throw e_1.error}}try{for(var _e=__values(left.entries()),_f=_e.next();!_f.done;_f=_e.next()){var index=_f.value;if(!equal(index[1],right.get(index[0]))){return false}}}catch(e_2_1){e_2={error:e_2_1}}finally{try{if(_f&&!_f.done&&(_b=_e.return))_b.call(_e)}finally{if(e_2)throw e_2.error}}return true}function equalSet(left,right){var e_3,_a;if(left.size!==right.size){return false}try{for(var _b=__values(left.entries()),_c=_b.next();!_c.done;_c=_b.next()){var index=_c.value;if(!right.has(index[0])){return false}}}catch(e_3_1){e_3={error:e_3_1}}finally{try{if(_c&&!_c.done&&(_a=_b.return))_a.call(_b)}finally{if(e_3)throw e_3.error}}return true}function equal(left,right){if(left===right){return true}if(left&&isObject(left)&&right&&isObject(right)){if(left.constructor!==right.constructor){return false}if(Array.isArray(left)&&Array.isArray(right)){return equalArray(left,right)}if(left instanceof Map&&right instanceof Map){return equalMap(left,right)}if(left instanceof Set&&right instanceof Set){return equalSet(left,right)}if(ArrayBuffer.isView(left)&&ArrayBuffer.isView(right)){return equalArrayBuffer(left,right)}if(isRegex(left)&&isRegex(right)){return left.source===right.source&&left.flags===right.flags}if(left.valueOf!==Object.prototype.valueOf){return left.valueOf()===right.valueOf()}if(left.toString!==Object.prototype.toString){return left.toString()===right.toString()}var leftKeys=Object.keys(left);var rightKeys=Object.keys(right);if(leftKeys.length!==rightKeys.length){return false}for(var index=leftKeys.length;index--!==0;){if(!Object.prototype.hasOwnProperty.call(right,leftKeys[index])){return false}}for(var index=leftKeys.length;index--!==0;){var key=leftKeys[index];if(key==="_owner"&&left.$$typeof){continue}if(!equal(left[key],right[key])){return false}}return true}if(Number.isNaN(left)&&Number.isNaN(right)){return true}return left===right}var DOM_PROPERTIES_TO_CHECK$1=["innerHTML","ownerDocument","style","attributes","nodeValue"];var objectTypes$1=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"];var primitiveTypes$1=["bigint","boolean","null","number","string","symbol","undefined"];function getObjectType$2(value){var objectTypeName=Object.prototype.toString.call(value).slice(8,-1);if(/HTML\w+Element/.test(objectTypeName)){return"HTMLElement"}if(isObjectType$1(objectTypeName)){return objectTypeName}return void 0}function isObjectOfType$1(type){return function(value){return getObjectType$2(value)===type}}function isObjectType$1(name){return objectTypes$1.includes(name)}function isOfType$1(type){return function(value){return typeof value===type}}function isPrimitiveType$1(name){return primitiveTypes$1.includes(name)}function is$1(value){if(value===null){return"null"}switch(typeof value){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(is$1.array(value)){return"Array"}if(is$1.plainFunction(value)){return"Function"}var tagType=getObjectType$2(value);if(tagType){return tagType}return"Object"}is$1.array=Array.isArray;is$1.arrayOf=function(target,predicate){if(!is$1.array(target)&&!is$1.function(predicate)){return false}return target.every((function(d){return predicate(d)}))};is$1.asyncGeneratorFunction=function(value){return getObjectType$2(value)==="AsyncGeneratorFunction"};is$1.asyncFunction=isObjectOfType$1("AsyncFunction");is$1.bigint=isOfType$1("bigint");is$1.boolean=function(value){return value===true||value===false};is$1.date=isObjectOfType$1("Date");is$1.defined=function(value){return!is$1.undefined(value)};is$1.domElement=function(value){return is$1.object(value)&&!is$1.plainObject(value)&&value.nodeType===1&&is$1.string(value.nodeName)&&DOM_PROPERTIES_TO_CHECK$1.every((function(property){return property in value}))};is$1.empty=function(value){return is$1.string(value)&&value.length===0||is$1.array(value)&&value.length===0||is$1.object(value)&&!is$1.map(value)&&!is$1.set(value)&&Object.keys(value).length===0||is$1.set(value)&&value.size===0||is$1.map(value)&&value.size===0};is$1.error=isObjectOfType$1("Error");is$1.function=isOfType$1("function");is$1.generator=function(value){return is$1.iterable(value)&&is$1.function(value.next)&&is$1.function(value.throw)};is$1.generatorFunction=isObjectOfType$1("GeneratorFunction");is$1.instanceOf=function(instance,class_){if(!instance||!class_){return false}return Object.getPrototypeOf(instance)===class_.prototype};is$1.iterable=function(value){return!is$1.nullOrUndefined(value)&&is$1.function(value[Symbol.iterator])};is$1.map=isObjectOfType$1("Map");is$1.nan=function(value){return Number.isNaN(value)};is$1.null=function(value){return value===null};is$1.nullOrUndefined=function(value){return is$1.null(value)||is$1.undefined(value)};is$1.number=function(value){return isOfType$1("number")(value)&&!is$1.nan(value)};is$1.numericString=function(value){return is$1.string(value)&&value.length>0&&!Number.isNaN(Number(value))};is$1.object=function(value){return!is$1.nullOrUndefined(value)&&(is$1.function(value)||typeof value==="object")};is$1.oneOf=function(target,value){if(!is$1.array(target)){return false}return target.indexOf(value)>-1};is$1.plainFunction=isObjectOfType$1("Function");is$1.plainObject=function(value){if(getObjectType$2(value)!=="Object"){return false}var prototype=Object.getPrototypeOf(value);return prototype===null||prototype===Object.getPrototypeOf({})};is$1.primitive=function(value){return is$1.null(value)||isPrimitiveType$1(typeof value)};is$1.promise=isObjectOfType$1("Promise");is$1.propertyOf=function(target,key,predicate){if(!is$1.object(target)||!key){return false}var value=target[key];if(is$1.function(predicate)){return predicate(value)}return is$1.defined(value)};is$1.regexp=isObjectOfType$1("RegExp");is$1.set=isObjectOfType$1("Set");is$1.string=isOfType$1("string");is$1.symbol=isOfType$1("symbol");is$1.undefined=isOfType$1("undefined");is$1.weakMap=isObjectOfType$1("WeakMap");is$1.weakSet=isObjectOfType$1("WeakSet");function canHaveLength(){var arguments_=[];for(var _i=0;_i<arguments.length;_i++){arguments_[_i]=arguments[_i]}return arguments_.every((function(d){return is$1.string(d)||is$1.array(d)||is$1.plainObject(d)}))}function checkEquality(left,right,value){if(!isSameType(left,right)){return false}if([left,right].every(is$1.array)){return!left.some(hasValue(value))&&right.some(hasValue(value))}if([left,right].every(is$1.plainObject)){return!Object.entries(left).some(hasEntry(value))&&Object.entries(right).some(hasEntry(value))}return right===value}function compareNumbers(previousData,data,options){var actual=options.actual,key=options.key,previous=options.previous,type=options.type;var left=nested(previousData,key);var right=nested(data,key);var changed=[left,right].every(is$1.number)&&(type==="increased"?left<right:left>right);if(!is$1.undefined(actual)){changed=changed&&right===actual}if(!is$1.undefined(previous)){changed=changed&&left===previous}return changed}function compareValues(previousData,data,options){var key=options.key,type=options.type,value=options.value;var left=nested(previousData,key);var right=nested(data,key);var primary=type==="added"?left:right;var secondary=type==="added"?right:left;if(!is$1.nullOrUndefined(value)){if(is$1.defined(primary)){if(is$1.array(primary)||is$1.plainObject(primary)){return checkEquality(primary,secondary,value)}}else{return equal(secondary,value)}return false}if([left,right].every(is$1.array)){return!secondary.every(isEqualPredicate(primary))}if([left,right].every(is$1.plainObject)){return hasExtraKeys(Object.keys(primary),Object.keys(secondary))}return![left,right].every((function(d){return is$1.primitive(d)&&is$1.defined(d)}))&&(type==="added"?!is$1.defined(left)&&is$1.defined(right):is$1.defined(left)&&!is$1.defined(right))}function getIterables(previousData,data,_a){var _b=_a===void 0?{}:_a,key=_b.key;var left=nested(previousData,key);var right=nested(data,key);if(!isSameType(left,right)){throw new TypeError("Inputs have different types")}if(!canHaveLength(left,right)){throw new TypeError("Inputs don't have length")}if([left,right].every(is$1.plainObject)){left=Object.keys(left);right=Object.keys(right)}return[left,right]}function hasEntry(input){return function(_a){var key=_a[0],value=_a[1];if(is$1.array(input)){return equal(input,value)||input.some((function(d){return equal(d,value)||is$1.array(value)&&isEqualPredicate(value)(d)}))}if(is$1.plainObject(input)&&input[key]){return!!input[key]&&equal(input[key],value)}return equal(input,value)}}function hasExtraKeys(left,right){return right.some((function(d){return!left.includes(d)}))}function hasValue(input){return function(value){if(is$1.array(input)){return input.some((function(d){return equal(d,value)||is$1.array(value)&&isEqualPredicate(value)(d)}))}return equal(input,value)}}function includesOrEqualsTo(previousValue,value){return is$1.array(previousValue)?previousValue.some((function(d){return equal(d,value)})):equal(previousValue,value)}function isEqualPredicate(data){return function(value){return data.some((function(d){return equal(d,value)}))}}function isSameType(){var arguments_=[];for(var _i=0;_i<arguments.length;_i++){arguments_[_i]=arguments[_i]}return arguments_.every(is$1.array)||arguments_.every(is$1.number)||arguments_.every(is$1.plainObject)||arguments_.every(is$1.string)}function nested(data,property){if(is$1.plainObject(data)||is$1.array(data)){if(is$1.string(property)){var props=property.split(".");return props.reduce((function(acc,d){return acc&&acc[d]}),data)}if(is$1.number(property)){return data[property]}return data}return data}function treeChanges(previousData,data){if([previousData,data].some(is$1.nullOrUndefined)){throw new Error("Missing required parameters")}if(![previousData,data].every((function(d){return is$1.plainObject(d)||is$1.array(d)}))){throw new Error("Expected plain objects or array")}var added=function(key,value){try{return compareValues(previousData,data,{key:key,type:"added",value:value})}catch(_a){return false}};var changed=function(key,actual,previous){try{var left=nested(previousData,key);var right=nested(data,key);var hasActual=is$1.defined(actual);var hasPrevious=is$1.defined(previous);if(hasActual||hasPrevious){var leftComparator=hasPrevious?includesOrEqualsTo(previous,left):!includesOrEqualsTo(actual,left);var rightComparator=includesOrEqualsTo(actual,right);return leftComparator&&rightComparator}if([left,right].every(is$1.array)||[left,right].every(is$1.plainObject)){return!equal(left,right)}return left!==right}catch(_a){return false}};var changedFrom=function(key,previous,actual){if(!is$1.defined(key)){return false}try{var left=nested(previousData,key);var right=nested(data,key);var hasActual=is$1.defined(actual);return includesOrEqualsTo(previous,left)&&(hasActual?includesOrEqualsTo(actual,right):!hasActual)}catch(_a){return false}};var changedTo=function(key,actual){if(!is$1.defined(key)){return false}return changed(key,actual)};var decreased=function(key,actual,previous){if(!is$1.defined(key)){return false}try{return compareNumbers(previousData,data,{key:key,actual:actual,previous:previous,type:"decreased"})}catch(_a){return false}};var emptied=function(key){try{var _a=getIterables(previousData,data,{key:key}),left=_a[0],right=_a[1];return!!left.length&&!right.length}catch(_b){return false}};var filled=function(key){try{var _a=getIterables(previousData,data,{key:key}),left=_a[0],right=_a[1];return!left.length&&!!right.length}catch(_b){return false}};var increased=function(key,actual,previous){if(!is$1.defined(key)){return false}try{return compareNumbers(previousData,data,{key:key,actual:actual,previous:previous,type:"increased"})}catch(_a){return false}};var removed=function(key,value){try{return compareValues(previousData,data,{key:key,type:"removed",value:value})}catch(_a){return false}};return{added:added,changed:changed,changedFrom:changedFrom,changedTo:changedTo,decreased:decreased,emptied:emptied,filled:filled,increased:increased,removed:removed}}var DOM_PROPERTIES_TO_CHECK=["innerHTML","ownerDocument","style","attributes","nodeValue"];var objectTypes=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"];var primitiveTypes=["bigint","boolean","null","number","string","symbol","undefined"];function getObjectType$1(value){const objectTypeName=Object.prototype.toString.call(value).slice(8,-1);if(/HTML\w+Element/.test(objectTypeName)){return"HTMLElement"}if(isObjectType(objectTypeName)){return objectTypeName}return void 0}function isObjectOfType(type){return value=>getObjectType$1(value)===type}function isObjectType(name){return objectTypes.includes(name)}function isOfType(type){return value=>typeof value===type}function isPrimitiveType(name){return primitiveTypes.includes(name)}function is(value){if(value===null){return"null"}switch(typeof value){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(is.array(value)){return"Array"}if(is.plainFunction(value)){return"Function"}const tagType=getObjectType$1(value);if(tagType){return tagType}return"Object"}is.array=Array.isArray;is.arrayOf=(target,predicate)=>{if(!is.array(target)&&!is.function(predicate)){return false}return target.every((d=>predicate(d)))};is.asyncGeneratorFunction=value=>getObjectType$1(value)==="AsyncGeneratorFunction";is.asyncFunction=isObjectOfType("AsyncFunction");is.bigint=isOfType("bigint");is.boolean=value=>value===true||value===false;is.date=isObjectOfType("Date");is.defined=value=>!is.undefined(value);is.domElement=value=>is.object(value)&&!is.plainObject(value)&&value.nodeType===1&&is.string(value.nodeName)&&DOM_PROPERTIES_TO_CHECK.every((property=>property in value));is.empty=value=>is.string(value)&&value.length===0||is.array(value)&&value.length===0||is.object(value)&&!is.map(value)&&!is.set(value)&&Object.keys(value).length===0||is.set(value)&&value.size===0||is.map(value)&&value.size===0;is.error=isObjectOfType("Error");is.function=isOfType("function");is.generator=value=>is.iterable(value)&&is.function(value.next)&&is.function(value.throw);is.generatorFunction=isObjectOfType("GeneratorFunction");is.instanceOf=(instance,class_)=>{if(!instance||!class_){return false}return Object.getPrototypeOf(instance)===class_.prototype};is.iterable=value=>!is.nullOrUndefined(value)&&is.function(value[Symbol.iterator]);is.map=isObjectOfType("Map");is.nan=value=>Number.isNaN(value);is.null=value=>value===null;is.nullOrUndefined=value=>is.null(value)||is.undefined(value);is.number=value=>isOfType("number")(value)&&!is.nan(value);is.numericString=value=>is.string(value)&&value.length>0&&!Number.isNaN(Number(value));is.object=value=>!is.nullOrUndefined(value)&&(is.function(value)||typeof value==="object");is.oneOf=(target,value)=>{if(!is.array(target)){return false}return target.indexOf(value)>-1};is.plainFunction=isObjectOfType("Function");is.plainObject=value=>{if(getObjectType$1(value)!=="Object"){return false}const prototype=Object.getPrototypeOf(value);return prototype===null||prototype===Object.getPrototypeOf({})};is.primitive=value=>is.null(value)||isPrimitiveType(typeof value);is.promise=isObjectOfType("Promise");is.propertyOf=(target,key,predicate)=>{if(!is.object(target)||!key){return false}const value=target[key];if(is.function(predicate)){return predicate(value)}return is.defined(value)};is.regexp=isObjectOfType("RegExp");is.set=isObjectOfType("Set");is.string=isOfType("string");is.symbol=isOfType("symbol");is.undefined=isOfType("undefined");is.weakMap=isObjectOfType("WeakMap");is.weakSet=isObjectOfType("WeakSet");var src_default=is;var E_NOSCROLL=new Error("Element already at target scroll position");var E_CANCELLED=new Error("Scroll cancelled");var min=Math.min;var ms=Date.now;var scroll={left:make("scrollLeft"),top:make("scrollTop")};function make(prop){return function scroll2(el,to,opts,cb){opts=opts||{};if(typeof opts=="function")cb=opts,opts={};if(typeof cb!="function")cb=noop$1;var start=ms();var from=el[prop];var ease=opts.ease||inOutSine;var duration=!isNaN(opts.duration)?+opts.duration:350;var cancelled=false;return from===to?cb(E_NOSCROLL,el[prop]):requestAnimationFrame(animate2),cancel;function cancel(){cancelled=true}function animate2(timestamp){if(cancelled)return cb(E_CANCELLED,el[prop]);var now=ms();var time=min(1,(now-start)/duration);var eased=ease(time);el[prop]=eased*(to-from)+from;time<1?requestAnimationFrame(animate2):requestAnimationFrame((function(){cb(null,el[prop])}))}}}function inOutSine(n){return.5*(1-Math.cos(Math.PI*n))}function noop$1(){}const scroll$1=getDefaultExportFromCjs(scroll);var scrollparent={exports:{}};(function(module){(function(root,factory){if(module.exports){module.exports=factory()}else{root.Scrollparent=factory()}})(commonjsGlobal,(function(){var regex=/(auto|scroll)/;var parents=function(node,ps){if(node.parentNode===null){return ps}return parents(node.parentNode,ps.concat([node]))};var style=function(node,prop){return getComputedStyle(node,null).getPropertyValue(prop)};var overflow=function(node){return style(node,"overflow")+style(node,"overflow-y")+style(node,"overflow-x")};var scroll2=function(node){return regex.test(overflow(node))};var scrollParent2=function(node){if(!(node instanceof HTMLElement||node instanceof SVGElement)){return}var ps=parents(node.parentNode,[]);for(var i=0;i<ps.length;i+=1){if(scroll2(ps[i])){return ps[i]}}return document.scrollingElement||document.documentElement};return scrollParent2}))})(scrollparent);var scrollparentExports=scrollparent.exports;const scrollParent=getDefaultExportFromCjs(scrollparentExports);var isMergeableObject=function isMergeableObject2(value){return isNonNullObject(value)&&!isSpecial(value)};function isNonNullObject(value){return!!value&&typeof value==="object"}function isSpecial(value){var stringValue=Object.prototype.toString.call(value);return stringValue==="[object RegExp]"||stringValue==="[object Date]"||isReactElement(value)}var canUseSymbol=typeof Symbol==="function"&&Symbol.for;var REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(value){return value.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(val){return Array.isArray(val)?[]:{}}function cloneUnlessOtherwiseSpecified(value,options){return options.clone!==false&&options.isMergeableObject(value)?deepmerge(emptyTarget(value),value,options):value}function defaultArrayMerge(target,source,options){return target.concat(source).map((function(element){return cloneUnlessOtherwiseSpecified(element,options)}))}function getMergeFunction(key,options){if(!options.customMerge){return deepmerge}var customMerge=options.customMerge(key);return typeof customMerge==="function"?customMerge:deepmerge}function getEnumerableOwnPropertySymbols(target){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(target).filter((function(symbol){return target.propertyIsEnumerable(symbol)})):[]}function getKeys(target){return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))}function propertyIsOnObject(object,property){try{return property in object}catch(_){return false}}function propertyIsUnsafe(target,key){return propertyIsOnObject(target,key)&&!(Object.hasOwnProperty.call(target,key)&&Object.propertyIsEnumerable.call(target,key))}function mergeObject(target,source,options){var destination={};if(options.isMergeableObject(target)){getKeys(target).forEach((function(key){destination[key]=cloneUnlessOtherwiseSpecified(target[key],options)}))}getKeys(source).forEach((function(key){if(propertyIsUnsafe(target,key)){return}if(propertyIsOnObject(target,key)&&options.isMergeableObject(source[key])){destination[key]=getMergeFunction(key,options)(target[key],source[key],options)}else{destination[key]=cloneUnlessOtherwiseSpecified(source[key],options)}}));return destination}function deepmerge(target,source,options){options=options||{};options.arrayMerge=options.arrayMerge||defaultArrayMerge;options.isMergeableObject=options.isMergeableObject||isMergeableObject;options.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var sourceIsArray=Array.isArray(source);var targetIsArray=Array.isArray(target);var sourceAndTargetTypesMatch=sourceIsArray===targetIsArray;if(!sourceAndTargetTypesMatch){return cloneUnlessOtherwiseSpecified(source,options)}else if(sourceIsArray){return options.arrayMerge(target,source,options)}else{return mergeObject(target,source,options)}}deepmerge.all=function deepmergeAll(array,options){if(!Array.isArray(array)){throw new Error("first argument should be an array")}return array.reduce((function(prev,next){return deepmerge(prev,next,options)}),{})};var deepmerge_1=deepmerge;var cjs=deepmerge_1;const deepmerge$1=getDefaultExportFromCjs(cjs);var isRequiredIf$1={};Object.defineProperty(isRequiredIf$1,"__esModule",{value:true});var VALIDATOR_ARG_ERROR_MESSAGE="The typeValidator argument must be a function with the signature function(props, propName, componentName).",MESSAGE_ARG_ERROR_MESSAGE="The error message is optional, but must be a string if provided.",propIsRequired=function propIsRequired2(a,b,c,d){if("boolean"==typeof a)return a;return"function"==typeof a?a(b,c,d):!(true!==!!a)&&!!a},propExists=function propExists2(a,b){return Object.hasOwnProperty.call(a,b)},missingPropError=function missingPropError2(a,b,c,d){return d?new Error(d):new Error("Required "+a[b]+" `"+b+"`"+(" was not specified in `"+c+"`."))},guardAgainstInvalidArgTypes=function guardAgainstInvalidArgTypes2(a,b){if("function"!=typeof a)throw new TypeError(VALIDATOR_ARG_ERROR_MESSAGE);if(!!b&&"string"!=typeof b)throw new TypeError(MESSAGE_ARG_ERROR_MESSAGE)},isRequiredIf=function isRequiredIf2(a,b,c){return guardAgainstInvalidArgTypes(a,c),function(d,e,f){for(var _len=arguments.length,g=Array(3<_len?_len-3:0),_key=3;_key<_len;_key++)g[_key-3]=arguments[_key];return propIsRequired(b,d,e,f)?propExists(d,e)?a.apply(void 0,[d,e,f].concat(g)):missingPropError(d,e,f,c):a.apply(void 0,[d,e,f].concat(g))}};var _default=isRequiredIf$1.default=isRequiredIf;
|
22
22
|
/**!
|
23
23
|
* @fileOverview Kickass library to create and place poppers near their reference elements.
|
24
24
|
* @version 1.16.1
|