@elastic-suite/gally-admin-shared
Version:
Shared package for gally admin BO
35 lines • 256 kB
JavaScript
var k="api",b=process.env.NODE_ENV==="test"?"http://localhost/":process.env.NEXT_PUBLIC_API_URL?process.env.NEXT_PUBLIC_API_URL:process.env.REACT_APP_API_URL?process.env.REACT_APP_API_URL:`${typeof window<"u"?window.location.origin:""}/${process.env.NEXT_PUBLIC_API_ROUTE_PREFIX?process.env.NEXT_PUBLIC_API_ROUTE_PREFIX:k}`;b&&String(b).endsWith("/")&&(b=b.slice(0,-1));var j=b,st=`${b}/graphql`,Ge="?isSearchable=true",E="Authorization",O="Gally-Language",L="Content-Type",C=[401,403],R="currentPage",lt="pageSize",N="pagination",x="search",T=50;var nt="category";var Ne="cms_page";var qt=(s=>(s.CATEGORY="category",s.CHECKBOX="checkbox",s.SLIDER="slider",s.BOOLEAN="boolean",s.HISTOGRAM="histogram",s.HISTOGRAM_DATE="date_histogram",s))(qt||{});var _t=(r=>(r.ASC="asc",r.DESC="desc",r))(_t||{});var Gt=(o=>(o.ALL="massiveselection.all",o.ALL_ON_CURRENT_PAGE="massiveselection.allOnCurrentPage",o.NONE="massiveselection.none",o))(Gt||{}),D=(h=>(h.BOOLEAN="boolean",h.IMAGE="image",h.LABEL="label",h.NUMBER="number",h.PRICE="price",h.RANGE="range",h.SCORE="score",h.SELECT="select",h.STOCK="stock",h.STRING="string",h.TAG="tag",h.BUTTON="button",h.OPTGROUP="optgroup",h.RANGEDATE="rangeDate",h.REQUESTTYPE="requestType",h.RULEENGINE="ruleEngine",h.SLIDER="slider",h.MULTIPLEINPUT="multipleInput",h.SYNONYM="synonym",h.EXPANSION="expansion",h.PRODUCTINFO="productInfo",h.BOOSTPREVIEW="boostPreview",h.POSITIONEFFECT="positionEffect",h.PROPARTIONALTOATTRIBUTE="proportionalToAttribute",h))(D||{}),pt=(e=>(e.PIN="push-pin",e))(pt||{});var dt=(a=>(a.VIRTUAL_CATEGORY="GallyVirtualCategoryBundle",a.BOOST="GallyBoostBundle",a.THESAURUS="GallyThesaurusBundle",a.VECTOR_SEARCH="GallyVectorSearchBundle",a))(dt||{});var U=(a=>(a[a.FAILED=0]="FAILED",a[a.IDLE=1]="IDLE",a[a.LOADING=2]="LOADING",a[a.SUCCEEDED=3]="SUCCEEDED",a))(U||{});var zt=(w=>(w.ARRAY="array",w.BOOLEAN="boolean",w.INTEGER="integer",w.OBJECT="object",w.STRING="string",w))(zt||{});var kt=(s=>(s.OK="200",s.CREATED="201",s.NO_CONTENT="204",s.BAD_REQUEST="400",s.NOT_FOUND="404",s.UNPROCESSABLE_ENTITY="422",s))(kt||{}),ht=(w=>(w.DELETE="DELETE",w.GET="GET",w.PATCH="PATCH",w.POST="POST",w.PUT="PUT",w))(ht||{});var Nt=(a=>(a.CATALOG="product_catalog",a.SEARCH="product_search",a.COVERAGE_RATE="product_coverage_rate",a.AUTOCOMPLETE="product_autocomplete",a))(Nt||{});var X=(r=>(r.ATTRIBUTE="attribute",r.COMBINATION="combination",r))(X||{}),it=(l=>(l.BOOLEAN="boolean",l.CATEGORY="category",l.FLOAT="float",l.INT="int",l.REFERENCE="reference",l.SELECT="select",l.TEXT="text",l.DATE="date",l))(it||{}),H=(p=>(p.BOOLEAN="Boolean",p.FLOAT="Float",p.INT="Int",p.STRING="String",p.BOOLEAN_MULTIPLE="[Boolean]",p.FLOAT_MULTIPLE="[Float]",p.INT_MULTIPLE="[Int]",p.STRING_MULTIPLE="[String]",p.STRING_REQUIRED="String!",p))(H||{}),ct=(r=>(r.ALL="all",r.ANY="any",r))(ct||{});var ut=(r=>(r.SEARCH="search",r.CATEGORY="category",r))(ut||{});var Ut=(r=>(r.ADMIN="ROLE_ADMIN",r.CONTRIBUTOR="ROLE_CONTRIBUTOR",r))(Ut||{});var Qr=48,Yr=80,Kr=180,Zr=[{id:"sku",input:"string",name:"sku",label:"Code",type:"string"},{id:"image",input:"image",name:"image",label:"Image",type:"image"},{id:"name",input:"string",name:"name",label:"Name",type:"string"},{id:"score",input:"score",name:"score",label:"Score",type:"score"},{id:"stock",input:"stock",name:"stock",label:"Stock",type:"stock"},{id:"price",input:"price",name:"price",label:"Price",type:"price"}],to=[10,25,50],eo={["push-pin"]:"Pinned"};import{VariableType as d,jsonToGraphQLQuery as c}from"json-to-graphql-query";var wo=`query preview($localizedCatalog: String!, $search: String) {
previewBoost(
localizedCatalog: $localizedCatalog
requestType: product_search
search: $search
) {
id,
resultsBefore,
resultsAfter
}
}`;function so(){return c({query:{__name:"getPreview",__variables:{localizedCatalog:"String!",requestType:"ProductRequestTypeEnum!",currentBoost:"String!",search:"String",category:"String",currentPage:"Int",pageSize:"Int"},previewBoost:{__args:{localizedCatalog:new d("localizedCatalog"),requestType:new d("requestType"),currentBoost:new d("currentBoost"),search:new d("search"),currentCategoryId:new d("category"),currentPage:new d("currentPage"),pageSize:new d("pageSize")},id:!0,resultsBefore:!0,resultsAfter:!0,lastPage:!0,itemsPerPage:!0,totalItems:!0}}})}function lo(t=null,e=!1){let r=A(t,e);return c({query:{__name:"getProducts",__variables:{...r.variables},products:{__aliasFor:"products",__args:{...r.args},...r.fields}}})}function no(t=null,e=!1){let r=A(t,e);return c({query:{__name:"getPreviewProducts",__variables:{...r.variables,currentCategoryConfiguration:"String"},products:{__aliasFor:"previewProducts",__args:{...r.args,currentCategoryConfiguration:new d("currentCategoryConfiguration")},...r.fields}}})}function A(t=null,e=!1,r="Product",o={},a={}){return{variables:{requestType:"ProductRequestTypeEnum!",localizedCatalog:"String!",currentPage:"Int",currentCategoryId:"String",pageSize:"Int",search:"String",sort:"ProductSortInput"},args:{requestType:new d("requestType"),localizedCatalog:new d("localizedCatalog"),currentPage:new d("currentPage"),currentCategoryId:new d("currentCategoryId"),pageSize:new d("pageSize"),search:new d("search"),sort:new d("sort"),filter:t},fields:{collection:{__on:{__typeName:r,id:!0,sku:!0,name:!0,description:!0,score:!0,image:!0,stock:{status:!0},price:{price:!0},...o}},paginationInfo:{lastPage:!0,itemsPerPage:!0,totalCount:!0},sortInfo:{current:{field:!0,direction:!0}},...e&&{aggregations:{field:!0,label:!0,type:!0,date_format:!0,date_range_interval:!0,options:{count:!0,label:!0,value:!0},hasMore:!0}},...a}}}function Xt(t=null,e=!1){return B(t,e,nt)}function po(t,e=null,r=!1){let o=B(e,r,t);return c({query:{__name:"getDocuments",__variables:{...o.variables},documents:{__aliasFor:"documents",__args:{...o.args},...o.fields}}})}function ho(t,e=null,r=!1){let o=B(e,r,t,"VectorDocument");return c({query:{__name:"getVectorSearchDocuments",__variables:{...o.variables},vectorSearchDocuments:{__aliasFor:"vectorSearchDocuments",__args:{...o.args},...o.fields}}})}function B(t=null,e=!1,r="document",o="Document"){return{variables:{[`${r}EntityType`]:"String!",[`${r}LocalizedCatalog`]:"String!",[`${r}CurrentPage`]:"Int",[`${r}PageSize`]:"Int",[`${r}Search`]:"String",[`${r}Sort`]:"SortInput"},args:{entityType:new d(`${r}EntityType`),localizedCatalog:new d(`${r}LocalizedCatalog`),currentPage:new d(`${r}CurrentPage`),pageSize:new d(`${r}PageSize`),search:new d(`${r}Search`),sort:new d(`${r}Sort`),filter:t},fields:{collection:{__on:{__typeName:o,id:!0,score:!0,source:!0}},paginationInfo:{lastPage:!0,itemsPerPage:!0,totalCount:!0},sortInfo:{current:{field:!0,direction:!0}},...e&&{aggregations:{field:!0,label:!0,type:!0,date_format:!0,date_range_interval:!0,options:{count:!0,label:!0,value:!0},hasMore:!0}}}}}function io(t=null,e=null,r=!1){let o=A(t,r),a=Xt(e,r);return c({query:{__name:"getAutoCompleteDocuments",__variables:{...o.variables,...a.variables},products:{__aliasFor:"products",__args:{...o.args},...o.fields},categories:{__aliasFor:"documents",__args:{...a.args},...a.fields}}})}function co(t=null){return c({query:{__name:"viewMoreFacetOptions",__variables:{entityType:"String!",localizedCatalog:"String!",aggregation:"String!",search:"String"},viewMoreFacetOptions:{__args:{entityType:new d("entityType"),localizedCatalog:new d("localizedCatalog"),aggregation:new d("aggregation"),search:new d("search"),filter:t},id:!0,value:!0,label:!0,count:!0}}})}function uo(t=null){return c({query:{__name:"viewMoreProductFacetOptions",__variables:{localizedCatalog:"String!",aggregation:"String!",currentCategoryId:"String",search:"String"},viewMoreProductFacetOptions:{__args:{localizedCatalog:new d("localizedCatalog"),aggregation:new d("aggregation"),currentCategoryId:new d("currentCategoryId"),search:new d("search"),filter:t},id:!0,value:!0,label:!0,count:!0}}})}var go=`query getPosition( $categoryId: String!, $localizedCatalogId : Int! ) {
getPositionsCategoryProductMerchandising(categoryId: $categoryId, localizedCatalogId : $localizedCatalogId ) {
result
}
}
`,yo=`mutation savePositionsCategoryProductMerchandising( $categoryId: String!, $savePositionsCategory : String! ){
savePositionsCategoryProductMerchandising (
input: {
categoryId: $categoryId
positions: $savePositionsCategory
}
)
{categoryProductMerchandising {result}}
}
`;function mo(t=null,e=!1){let r=A(t,e,"ExplainProduct",{explanation:!0,sort:!0,boosts:!0,matches:!0,highlights:!0,legends:!0,fieldHighlights:!0},{explainData:{elasticSearchQuery:{index:!0,query:!0},isSpellchecked:!0,extraData:!0}});return c({query:{__name:"getExplainProducts",__variables:{...r.variables},explain:{__aliasFor:"explain",__args:{...r.args},...r.fields}}})}var gt=/^is([A-Z][a-zA-Z]+)/,yt=/<(.+)>; rel="http:\/\/www.w3.org\/ns\/hydra\/core#apiDocumentation"/;var xo="product";var mt={type:"combination",operator:"all",value:!0,children:[]},Fo={type:"attribute",field:"",operator:"",attribute_type:"text",value:""},V=["Int","Float"],Po=",";import{createTheme as Ht}from"@mui/material/styles";import{keyframes as Bt}from"@emotion/react";var Vt=Bt`
0% {
transform: scale(0);
opacity: 0.3;
}
100% {
transform: scale(1);
opacity: 0.6;
}
`,Lo=Ht({palette:{background:{page:"#FAFBFE"},primary:{light:"#FBC0B9",main:"#ED7465",dark:"#A02213"},secondary:{light:"#BABDFC",main:"#2C19CD",dark:"#1812A0"},neutral:{light:"#F4F7FF",main:"#B5B9D9",dark:"#2F3674",contrastText:"#FFFFFF"},error:{light:"#FFE7E4",main:"#A02213"},warning:{light:"#FEF9D0",main:"#60590D"},success:{light:"#E7F4EC",main:"#18753C"},menu:{text500:"#424880",text600:"#212250",hover:"#E7E8FF",active:"#2C19CD"},colors:{white:"#FFF",black:"#000",primary:{main:"#ED7465",100:"#FFE7E4",200:"#FBC0B9",300:"#F3978C",400:"#ED7465",500:"#E64733",600:"#CC2D19",700:"#A02213",800:"#73170C",900:"#460C05"},secondary:{main:"#2C19CD",100:"#E7E8FF",200:"#BABDFC",300:"#8D8DF3",400:"#6460ED",500:"#3F32E6",600:"#2C19CD",700:"#1812A0",800:"#0D1274",900:"#070F47"},neutral:{100:"#FAFBFE",200:"#F4F7FF",300:"#E2E6F3",400:"#B5B9D9",500:"#8187B9",600:"#424880",700:"#2F3674",800:"#212250",900:"#151A47"},gradient:{default:"linear-gradient(46.78deg, #E64733 1.79%, #ED7465 98.88%)",darken:"linear-gradient(46.78deg, #CC2D19 1.79%, #E64733 98.88%)"},shadow:{neutral:{sm:"4px 4px 14px rgba(226, 230, 243, 0.5)",md:"0px -8px 8px rgba(226, 230, 243, 0.2), 0px 5px 8px rgba(107, 113, 166, 0.1), 4px 4px 14px rgba(226, 230, 243, 0.5)",lg:"0px -8px 8px rgba(226, 230, 243, 0.2), 0px 8px 8px rgba(107, 113, 166, 0.2), 4px 4px 14px rgba(226, 230, 243, 0.5)"},primaryButton:{sm:"0px -8px 8px rgba(255, 231, 228, 0.2), 0px 8px 8px rgba(243, 151, 140, 0.2), 4px 4px 14px rgba(255, 231, 228, 0.5)",md:"0px -8px 8px rgba(255, 231, 228, 0.2), 0px 16px 16px rgba(243, 151, 140, 0.2), 4px 4px 14px rgba(255, 231, 228, 0.5)",lg:"0px -8px 8px rgba(255, 231, 228, 0.2), 0px 16px 36px rgba(243, 151, 140, 0.2), 4px 4px 14px rgba(255, 231, 228, 0.5)"},secondaryButton:{sm:"0px -8px 8px rgba(231, 232, 255, 0.2), 0px 8px 8px rgba(186, 189, 252, 0.05), 4px 4px 14px rgba(231, 232, 255, 0.5)",md:"0px -8px 8px rgba(231, 232, 255, 0.2), 0px 16px 16px rgba(186, 189, 252, 0.2), 4px 4px 14px rgba(231, 232, 255, 0.5)",lg:"0px -8px 8px rgba(231, 232, 255, 0.2), 0px 16px 36px rgba(186, 189, 252, 0.4), 4px 4px 14px rgba(231, 232, 255, 0.5)"}}},mode:"light"},shape:{borderRadius:8},typography:{h1:{fontSize:36,lineHeight:"44px",fontWeight:600},h2:{fontSize:28,lineHeight:"38px",fontWeight:600},h3:{fontSize:24,lineHeight:"32px",fontWeight:600},h4:{fontSize:20,lineHeight:"30px",fontWeight:600},h5:{fontSize:18,lineHeight:"28px",fontWeight:600},h6:{fontSize:16,lineHeight:"24px",fontWeight:600},body1:{fontSize:14,lineHeight:"20px",fontWeight:500},body2:{fontSize:14,lineHeight:"20px",fontWeight:400},caption:{fontSize:12,lineHeight:"18px",fontWeight:400}},components:{MuiCollapse:{styleOverrides:{wrapper:{width:"100%"},wrapperInner:{width:"100%"}}},MuiButtonBase:{defaultProps:{disableRipple:!1}},MuiButton:{styleOverrides:{root:{minWidth:32}}},MuiCheckbox:{styleOverrides:{root:{transform:"scale(0.9)",color:"#B5B9D9",transition:"all 0.3s linear","&:hover":{backgroundColor:"rgba(21, 26, 71, 0.08)"},"&:focus":{backgroundColor:"rgba(21, 26, 71, 0.12)"},".MuiTouchRipple-child":{backgroundColor:"rgba(21, 26, 71)"},"&.Mui-checked, &.MuiCheckbox-indeterminate":{"&:hover":{backgroundColor:"rgba(237, 116, 101, 0.08)"},"&:focus":{backgroundColor:"rgba(237, 116, 101, 0.12)"},".MuiTouchRipple-child":{backgroundColor:"rgba(237, 116, 101)"}},"&.Mui-disabled":{color:"#E2E6F3"}}}},MuiRadio:{styleOverrides:{root:{transform:"scale(0.9)",color:"#B5B9D9",transition:"all 0.3s linear","&:hover":{backgroundColor:"rgba(21, 26, 71, 0.08)"},"&:focus":{backgroundColor:"rgba(21, 26, 71, 0.12)"},".MuiTouchRipple-child":{backgroundColor:"rgba(21, 26, 71)"},"&.Mui-checked":{"&:hover":{backgroundColor:"rgba(237, 116, 101, 0.08)"},"&:focus":{backgroundColor:"rgba(237, 116, 101, 0.12)"},".MuiTouchRipple-child":{backgroundColor:"rgba(237, 116, 101)"}},"&.Mui-disabled":{color:"#E2E6F3"}}}},MuiSwitch:{styleOverrides:{thumb:{background:"#FFF",border:"1px solid #B5B9D9",boxSizing:"border-box",boxShadow:"0px 6px 10px rgba(0, 0, 0, 0.05)",borderRadius:"22px",width:"19px",height:"19px"},track:{backgroundColor:"#B5B9D9",borderRadius:"22px",opacity:"1",height:"13px"},switchBase:{transition:"all 0.3s linear","&:hover":{backgroundColor:"rgba(21, 26, 71, 0.08)"},"&:focus":{backgroundColor:"rgba(21, 26, 71, 0.12)"},".MuiTouchRipple-child":{backgroundColor:"rgba(21, 26, 71)"},"&.Mui-checked":{"&:hover":{backgroundColor:"rgba(237, 116, 101, 0.08)"},"&:focus":{backgroundColor:"rgba(237, 116, 101, 0.12)"},".MuiTouchRipple-child":{backgroundColor:"rgba(237, 116, 101)"},"& .MuiSwitch-thumb":{border:"0",background:"linear-gradient(46.78deg, #E64733 1.79%, #ED7465 98.88%)",boxShadow:"0px 6px 10px rgba(237, 116, 101, 0.1)"},"& + .MuiSwitch-track":{backgroundColor:"#E64733",opacity:"0.2"}},"&.Mui-disabled":{"+ .MuiSwitch-track":{opacity:1,backgroundColor:"rgba(181, 185, 217, 0.3)"},"& .MuiSwitch-thumb":{border:"1px solid rgba(181, 185, 217, 0.3)"},"&.Mui-checked":{"+ .MuiSwitch-track":{opacity:.2,backgroundColor:"rgba(230, 71, 51, 0.3)"},"& .MuiSwitch-thumb":{boxShadow:"none",opacity:.3}}}}}},MuiFab:{styleOverrides:{root:{color:"#FFF",fontSize:"26px",background:"linear-gradient(46.78deg, #E64733 1.79%, #ED7465 98.88%)",boxShadow:"0px -8px 8px rgba(255, 231, 228, 0.2), 0px 16px 16px rgba(243, 151, 140, 0.2), 4px 4px 14px rgba(255, 231, 228, 0.5)",width:"56px",height:"56px",zIndex:1,"&::before":{position:"absolute",content:'""',top:0,right:0,bottom:0,left:0,borderRadius:"50%",background:"linear-gradient(46.78deg, #CC2D19 1.79%, #E64733 98.88%)",boxShadow:"0px -8px 8px rgba(255, 231, 228, 0.2), 0px 16px 36px rgba(243, 151, 140, 0.2), 4px 4px 14px rgba(255, 231, 228, 0.5)",zIndex:-1,transition:"opacity 0.3s linear",opacity:0},"&:hover::before":{opacity:1},"&:hover":{background:"linear-gradient(46.78deg, #E64733 1.79%, #ED7465 98.88%)",boxShadow:"0px -8px 8px rgba(255, 231, 228, 0.2), 0px 16px 16px rgba(243, 151, 140, 0.2), 4px 4px 14px rgba(255, 231, 228, 0.5)"},"&& .MuiTouchRipple-child":{backgroundColor:"#CC2D19",opacity:1},"&& .MuiTouchRipple-rippleVisible":{animationName:`${Vt}`},"&.Mui-disabled":{color:"#8187B9",background:"#E2E6F3"}}}},MuiFormControlLabel:{styleOverrides:{root:{color:"#151A47",fontSize:"14px",lineHeight:"20px",fontWeight:400},label:{"&.Mui-disabled":{color:"#8187B9"}}}},MuiInputLabel:{styleOverrides:{root:{WebkitTransform:"none",transform:"none",fontWeight:500,lineHeight:"20px",color:"#151A47",fontFamily:"var(--gally-font)","&.Mui-focused":{color:"#151A47"}},shrink:{fontSize:14,color:"#151A47"},asterisk:{color:"#CC2D19"}}},MuiFormHelperText:{styleOverrides:{root:{display:"flex",color:"#424880",fontWeight:400,fontSize:"12px",lineHeight:"18px",margin:"8px 0 0 0",".MuiInputBase-colorSuccess + &":{color:"#18753C"},".MuiInputBase-colorError + &, .textarea--error + &":{color:"#A02213"}}}},MuiInputBase:{styleOverrides:{root:{fontFamily:"var(--gally-font)"}}},MuiFormControl:{styleOverrides:{root:{textarea:{borderColor:"#E2E6F3",borderStyle:"solid",borderWidth:"1px",borderRadius:8,background:"#FFF",color:"#151A47",fontWeight:400,fontSize:14,lineHeight:"20px",padding:16,transition:"border-color 0.3s linear","&:hover":{borderColor:"#B5B9D9"},"&.textarea--filled":{borderColor:"#B5B9D9"},"&:focus":{borderColor:"#424880"},"&.textarea--error":{borderColor:"#A02213"},"&:disabled":{pointerEvents:"none",color:"#424880",background:"#E2E6F3",borderColor:"#E2E6F3"},"&:focus-visible":{outline:"none"},"&::placeholder":{color:"#424880",opacity:1},"&::-webkit-resizer":{background:"no-repeat 100% 100%/150% url(/images/corner-expand.svg)"}},"label + textarea":{marginTop:24}}}},MuiDialog:{styleOverrides:{paper:{borderRadius:8,padding:32,width:"600px"}}},MuiBackdrop:{styleOverrides:{root:{background:"rgba(21, 26, 71, 0.6)"}}},MuiDialogActions:{styleOverrides:{root:{"> :not(:first-of-type)":{marginLeft:0}}}},MuiTab:{styleOverrides:{root:{textTransform:"none",fontSize:"16px",lineHeight:"24px",fontWeight:"500",color:"#424880","&.Mui-selected":{color:"#2C19CD"}}}},MuiTabs:{styleOverrides:{indicator:{backgroundColor:"#2C19CD"}}},MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:"#FFF",color:"#151A47",fontSize:"12px",fontWeight:"400",lineHeight:"18px",padding:"16px",borderRadius:"8px",boxShadow:"rgba(100, 100, 111, 0.2) 0px 7px 29px 0px"},arrow:{color:"#FFF"}}},MuiTablePagination:{styleOverrides:{selectLabel:{display:"flex"},displayedRows:{display:"flex"},select:{paddingTop:"5px"}}}}});var J="-";var g="gallyToken";import{createContext as Jt}from"react";var Jo=Jt(null);import{useEffect as Te,useState as De}from"react";function Wt(t=""){if(process.env.NEXT_PUBLIC_LOCAL)try{let e=new URL(t);e.origin===j&&(e.pathname==="/"&&(e.pathname="/index"),e.pathname&&!e.pathname.endsWith(".json")&&!e.pathname.endsWith(".jsonld")&&(e.pathname=`${e.pathname}.json`),e.pathname.endsWith(".jsonld")&&(e.pathname=`${e.pathname.slice(0,-7)}.json`),e.pathname.startsWith("/mocks")||(e.pathname=`/mocks${e.pathname}`),t=e.href)}catch{}return t}async function y(t,e={}){(!e.method||e.method==="GET")&&(t=Wt(t.toString()));let r=await fetch(t,e);return{json:(r==null?void 0:r.status)!==204?await r.json():{},response:r}}var M=class extends Error{constructor(r){super(r["hydra:description"]);this.error=r}};function ft(t){return"@type"in t}function bt(t){return t["@type"]==="hydra:Error"}function ta(t,e){return t.find(r=>r.title===e||r.label===e)}function W(t){return t.endsWith("[]")?t.slice(0,-2):t.endsWith("[between]")?t.slice(0,-9):t}function $(t,e){return e=W(e),t.supportedProperty.find(r=>{var o;return r.title===e||((o=r==null?void 0:r.gally)==null?void 0:o.alias)===e})}function S(t){var e,r;switch((r=(e=t.property)==null?void 0:e.range)==null?void 0:r["@id"]){case"http://www.w3.org/2001/XMLSchema#array":return"array";case"http://www.w3.org/2001/XMLSchema#integer":return"integer";case"http://www.w3.org/2001/XMLSchema#decimal":case"http://www.w3.org/2001/XMLSchema#float":return"float";case"http://www.w3.org/2001/XMLSchema#boolean":return"boolean";case"http://www.w3.org/2001/XMLSchema#date":return"date";case"http://www.w3.org/2001/XMLSchema#dateTime":return"dateTime";default:return"text"}}function xt(t){return t.property["@type"]==="http://www.w3.org/ns/hydra/core#Link"}function ea(t,e){return t.find(r=>r["@id"]===e.property.range["@id"])}function ra(t){return t["hydra:member"].map(e=>({id:e.id,label:e["@id"],value:e.id}))}function oa(t){return t["hydra:member"].map(e=>({id:e.id,label:e.label,value:e.id}))}function aa(t,e=-1){return t["hydra:member"].map(r=>{var a;let o=r.defaultLabel;return e!==-1&&(o=((a=r.labels.find(w=>w.localizedCatalog.id===e))==null?void 0:a.label)??o),{id:r.code,label:o,value:r.code}})}function wa(t){return t["hydra:member"].map(e=>({id:e.sourceFieldOption.code,label:e.label,value:e.sourceFieldOption.code}))}function $t(t){return t.flatMap(({label:e,options:r})=>r.map(o=>({id:e,value:o.value,label:o.label})))}function sa(t){let e=t["hydra:member"].map(({label:r,value:o,code:a,options:w})=>({label:r,value:o??a,options:w}));return e.some(({options:r})=>r)?$t(e):e}function vt(t,e){if(e instanceof Array)return e.map(r=>vt(t,r));if(xt(t))return Number(e);switch(S(t)){case"integer":return e&&Number(e);case"boolean":return e!=="true"&&e!=="false"?null:e==="true";default:return e}}function Ct(t,e){if(e instanceof Array)return e.every(r=>Ct(t,r));if(xt(t))return typeof e=="number"&&!isNaN(e);switch(S(t)){case"integer":return typeof e=="number"&&!isNaN(e)||e==="";case"boolean":return typeof e=="boolean";default:return typeof e=="string"}}function la(t,e){return Object.fromEntries(Object.entries(e).reduce((r,[o,a])=>{let w=$(t,o);if(w){let s=vt(w,a);Ct(w,s)&&r.push([o,s])}return r},[]))}function Qt(t,e){return e!==void 0?e:t}function Yt(t){switch(t){case"requestType":case"searchLimitations":case"categoryLimitations":case"optgroup":case"synonym":case"expansion":return[];case"ruleEngine":return'{"type":"combination","operator":"all","value":"true","children":[]}';case"rangeDate":return{fromDate:null,toDate:null};case"proportionalToAttribute":return{source_field_code:void 0,boost_impact:void 0,scale_factor:1};default:return""}}function Kt(t,e){switch(t){case"boolean":return!1;case"array":case"select":return[];case"number":case"integer":case"float":case"slider":return 0;case"date":case"dateTime":return null;default:return e?Yt(e):""}}function na(t){return Object.fromEntries(t.supportedProperty.filter(r=>{var o;return(o=r==null?void 0:r.gally)==null?void 0:o.visible}).map(r=>{var o,a;return[r.title,Qt(Kt(S(r),(o=r==null?void 0:r.gally)==null?void 0:o.input),(a=r.gally)==null?void 0:a.defaultValue)]}))}var m=class extends Error{};function Q(t){return"error"in t||"violations"in t}function q(t){if(typeof window<"u")return localStorage.getItem(t)}function ha(t,e){typeof window<"u"&&localStorage.setItem(t,e)}function I(t){typeof window<"u"&&localStorage.removeItem(t)}function Y(t,e={}){let r=t instanceof URL?t:new URL(t);return Object.entries(e).forEach(([o,a])=>{o.endsWith("[between]")?(a=a,(a[0]!==""||a[1]!=="")&&r.searchParams.append(o,a.join(J))):a instanceof Array?a.forEach(w=>r.searchParams.append(o,String(w))):r.searchParams.append(o,String(a))}),r}function St(t){return[...t.searchParams.entries()].forEach(([e])=>t.searchParams.delete(e)),t}function Zt(t=0,e={},r=""){return typeof t=="number"?F({...e,[R]:t===0?"":t,[x]:r}):F({...e,[x]:r})}function K(t=0,e=T,r={},o=""){return typeof t=="number"?F({...r,[R]:t+1,[N]:!0,[lt]:e,[x]:o}):F({...r,[N]:!1,[x]:o})}function It(t){return new URL(`${window.location.origin}${t}`)}function ga(t){let e=It(t);return St(e).pathname}function ya(t,e=0,r,o){let a=Zt(e,r,o),w=It(t);return Y(St(w),a)}function ma(t){return Object.fromEntries([...t.searchParams.entries()].reduce((e,[r,o])=>{var a;if(r.endsWith("[between]"))e.push([r,o.split(J)]);else if(r.endsWith("[]")){let w=(a=e.find(([s])=>s===r))==null?void 0:a[1];w?w.push(o):e.push([r,[o]])}else e.push([r,o]);return e},[]))}function fa(t){let e=Object.entries(t).find(([r])=>r===R);return Number((e==null?void 0:e[1])??0)}function ba(t){let e=Object.entries(t).find(([r])=>r===x);return String((e==null?void 0:e[1])??"")}var Z=class extends Error{};function te(t){return"code"in t&&"message"in t}function _(t=""){return t.startsWith("http")||(t.length&&!t.startsWith("/")&&(t=`/${t}`),t=`${j}${t}`),t}function Ma(t,e,r={},o={},a=!0){let w=_(typeof e=="string"?e:e.url),s={[O]:t,[L]:"application/ld+json",...o.headers},n=q(g);return a&&n&&(s[E]=`Bearer ${n}`),y(Y(w,r).href,{...o,headers:s}).then(({json:l,response:p})=>{if(te(l))throw C.includes(l.code)?(I(g),new m(l.message)):new Z(l.message);if(ft(l)&&bt(l))throw new M(l);if(C.includes(p.status))throw I(g),new m("Unauthorized/Forbidden");return l})}function F(t={}){return Object.fromEntries(Object.entries(t).filter(([e,r])=>(r??"")!==""))}function qa(t={}){return Object.fromEntries(Object.entries(t).reduce((e,[r,o])=>{if(r.endsWith("[between]")){let a=W(r);o=o,o[0]!==""&&e.push([`${a}[gte]`,o[0]]),o[1]!==""&&e.push([`${a}[lte]`,o[1]])}else e.push([r,o]);return e},[]))}function _a(t,e){if(!t&&!e||!t&&e)return!1;if(t&&!e)return!0;let r={...t};return Object.keys(r).forEach(o=>{o in e&&delete r[o]}),Object.keys(r).length>0}async function Ga(t,e,r,o,a=T){let w=0,s=K(w,a,r),n=await t(e,s,o);if(Q(n))return{error:n.error,status:0};let l=n["hydra:totalItems"],p=[];for(;l>(w+1)*a;w++)s=K(w+1,a,r),p.push(t(e,s,o));let u=await Promise.all(p),i=[],P=u.flatMap(f=>Q(f)?(i.push(f),[]):f["hydra:member"]);return i.length>0?{error:i[0].error,status:0}:(n["hydra:member"].push(...P),{data:n,status:3})}function ka(t){if(typeof t=="string")return[t];let e=[t[0]];for(let r=0;r<t.length-1;r++)e.push(`${e[r]}_${t[r+1]}`);return e}function ee(t,e,r,o=0){if(typeof r=="object"){for(let a in r)if(r[a].code===e[o])return t===o?r[a].label:ee(t,e,r[a].children,o+1)}return null}function Xa(t){return t.includes("GallyVirtualCategoryBundle")}function re(t){let e=t?t.filter(r=>r.localizedCatalogs.find(o=>o.isDefault))[0]:null;return e?{...e,localizedCatalogs:e.localizedCatalogs.filter(r=>r.isDefault)}:null}function oe(t){var r;let e=re(t);return(r=e==null?void 0:e.localizedCatalogs)==null?void 0:r[0]}function Ba(t,e,r){if(e){if(e&&!r)return t.filter(o=>o.id===e.id).map(o=>o.localizedCatalogs[0]).flat()[0]}else return oe(t);return r}function Va(t,e){let r;return t.some(o=>(r=new Map(o==null?void 0:o.localizedCatalogs.map(w=>[String(w.id),w])).get(String(e)),r)),r}function ae(t,e){t.forEach(r=>{e.push(r),r.children&&ae(r.children,e)})}function Ft(t,e,r=" / "){var a;let o="";if(t.length>0){let w=e.find(s=>s.id===t[0]);if(!w)return console.error(`Wrong path ${t.join("/")}`),`/${t.join("/")}`;if(w.level===1){let[s,...n]=t;return Ft(n,(w==null?void 0:w.children)??[],r)}t.shift(),o=(w==null?void 0:w.name)+(((a=w==null?void 0:w.children)==null?void 0:a.length)>0&&t.length>0?r:"")+Ft(t,(w==null?void 0:w.children)??[],r)}return o}function Ya(t,e){var o;let r=Boolean(t==null?void 0:t.localizedCatalog)&&Boolean(t==null?void 0:t.requestType);return e==="category"?r=r&&Boolean(t==null?void 0:t.category):e==="search"&&(r=r&&Boolean((o=t==null?void 0:t.search)==null?void 0:o.trim())),r}function Ka(t,e){let r={...t};return e==="category"?delete r.search:e==="search"&&delete r.category,r}var we=(r=>(r.GRID="grid",r.FORM="form",r))(we||{});function tw(t,e,r){var w,s,n;let o=t;e!=null&&e.includes("admin/settings")?e="settings_attribute":e=e==null?void 0:e.replaceAll("/","_").replace("_admin_","");let a=(w=t.gally)==null?void 0:w[r];if(a&&(o={...o,gally:{...t.gally,...a}}),(s=t.gally)!=null&&s.context){let l=Object.entries((n=t.gally)==null?void 0:n.context).find(([p,u])=>p===e);l&&(o={...o,gally:{...t.gally,...l[1]}})}return o}function ew(t){var e;return Boolean((e=t.gally)==null?void 0:e.options)}function rw(t){return"values"in t}function Pt(t,e){if(!Array.isArray(e))return t[e.field]===e.value;let r=!1,o=0;for(;!r&&o<e.length;){let a=e[o];if(Array.isArray(a))r=a.every(({field:w,value:s})=>t[w]===s);else{let{field:w,value:s}=a;r=t[w]===s}o++}return r}function se(t,e,r={}){if(!t)return{};if(!(e!=null&&e.conditions))return r;let{conditions:o,type:a}=e,w={};switch(a){case"visible":w.visible=Pt(t,o);break;case"enabled":w.disabled=!Pt(t,o)}return{...w,...r}}function ow(t,e,r={}){let{visible:o,...a}=se(t,e,r);return a}function aw(t){return"children"in t}function sw(t){for(let e in t)if(t[e])return e}function le(t,e,r){if(!t||!e)return[];let o=[];return t.requestTypes.filter(a=>!a.applyToAll).forEach(a=>{var l;let w=(l=e.find(p=>p.value===a.requestType))==null?void 0:l.limitationType,s=t[`${w}Limitations`],n=s==null?void 0:s.find(p=>(p==null?void 0:p.queryText)===null);switch(w){case"category":(s==null?void 0:s.length)===0&&o.push(r("empty.categoryLimitations"));return;case"search":(s==null?void 0:s.length)===0?o.push(r("empty.searchLimitations")):n&&o.push(r("empty.searchLimitations.queryText"))}}),o}function lw(t,e,r){var o;return((o=le(t,e,r))==null?void 0:o.length)===0}function ne(t){let e=[];return t.forEach(r=>{if(r.terms.length===0)e.push("synonym.error_message.terms.size.invalid");else{r.terms.length<2?e.push("synonym.error_message.terms.size.invalid"):r.terms.forEach(a=>{(a.term===void 0||a.term==="")&&e.push("synonym.error_message.terms.size.invalid")});let o=r.terms.map(a=>a.term);o.length!==[...new Set(o)].length&&e.push("synonym.error_message.terms.duplicate")}}),[...new Set(e)]}function nw(t){return ne(t).length===0}function pe(t){let e=[],r=[];return t.forEach(o=>{if(o.referenceTerm===void 0||o.referenceTerm===""?e.push("expansion.error_message.reference_term.empty"):r.push(o.referenceTerm),o.terms.length===0)e.push("expansion.error_message.expansion_terms.empty");else{o.terms.forEach(w=>{(w.term===void 0||w.term==="")&&e.push("expansion.error_message.expansion_terms.empty")});let a=o.terms.map(w=>w.term);a.length!==[...new Set(a)].length&&e.push("expansion.error_message.expansion_terms.duplicate")}}),r.length!==[...new Set(r)].length&&e.push("expansion.error_message.reference_terms.duplicate"),[...new Set(e)]}function pw(t){return pe(t).length===0}import de from"inflection";function he(t){return t[0].toUpperCase()+t.slice(1)}function ie(t){return t[0].toLowerCase()+t.slice(1)}function cw(t){return ie(t.substring(7))}function ce(t){return de.transform(t,["underscore","humanize"])}function uw(t){return`${t} - Gally`}function tt(...t){return t.map(e=>e?e.slice(Number(e.at(0)==="/"),e.at(-1)==="/"?-1:void 0):"").join("/")}function gw(t){return Object.keys(t).length===0}function yw(t,e){return Object.entries(t).reduce((r,[o,a])=>({...r,[e+he(o)]:a}),{})}function mw(t){return t.join(`
`)}function G(t,e){let{sourceWithoutDigits:r,sourceSuffix:o}=ue(t),a=ce(o.replace(/\./g," "));return e?[`resources.${e}.fields.${r}`,a]:[`fields.${r}`,a]}function ue(t){let e=t.replace(/\.\d+\./g,"."),r=t.split("."),o;r.forEach((w,s)=>{ge(w)&&(o=s)});let a=o!==null&&typeof o<"u"?r.slice(o+1).join("."):t;return{sourceWithoutDigits:e,sourceSuffix:a}}function ge(t){for(let e=t.length-1;e>=0;e--){let r=t.charCodeAt(e);if(r<48||r>57)return!1}return!0}function fw(t,e,r){return new Intl.NumberFormat(r,{style:"currency",currency:`${e}`}).format(t)}function bw(t,e){return e?e.charAt(0)===t?e.substring(1):e:null}function et(t){return t.split("/").pop()}function xw(t,e){return`/${process.env.NEXT_PUBLIC_API_ROUTE_PREFIX?process.env.NEXT_PUBLIC_API_ROUTE_PREFIX:k}/${t}/${e}`.replace(/\/+/g,"/")}function vw(t,e,r=!1){let o=Math.round((t+Number.EPSILON)*10**e)/10**e;return r?o.toFixed(e):o}var rt=class extends Error{constructor(r){super(r[0].message);this.errors=r}};function ye(t){return"errors"in t}function jw(t,e,r,o={},a=!0){let w={[O]:t,[L]:"application/json",...o.headers},s=q(g);return a&&s&&(w[E]=`Bearer ${s}`),y(st,{body:JSON.stringify({query:e,variables:r}),method:"POST",...o,headers:w}).then(({json:n,response:l})=>{if(ye(n))throw new rt(n.errors);if(C.includes(l.status))throw I(g),new m("Unauthorized/Forbidden");return n.data})}function Ow(t){return t.displayName||t.name||"Component"}function Rw(t){let e=t.localizedCatalogs.map(r=>r.localName);return[...new Set(e)]}function Dw(t,e){(process.env.NODE_ENV==="development"||typeof window<"u"&&window.showErrors===!0)&&console.error(t),e&&e(typeof t=="string"?t:t.message)}function Mw(t,e){return Object.entries(t).map(([r,o])=>({value:o,label:e(r)}))}import jt from"jsonld";function me(t,e){if(process.env.NEXT_PUBLIC_LOCAL)return`${e}/docs.jsonld`;let r=t.get("Link");if(r)return yt.exec(r)[1]}async function fe(t){let{json:e,response:r}=await y(t,{headers:{"Content-Type":"application/ld+json"}}),o=me(r.headers,t),{json:a}=await y(o,{headers:{"Content-Type":"application/ld+json"}}),[w,s]=await Promise.all([jt.expand(a,{base:o}),jt.expand(e,{base:t})]);return{docs:w[0],docsUrl:o,entrypoint:s[0],entrypointUrl:t}}function be(t){return new Map(t["http://www.w3.org/ns/hydra/core#supportedClass"].map(e=>[e["@id"],e]))}function xe(t){return"http://www.w3.org/2002/07/owl#equivalentClass"in t}function ve(t,e){if(e["http://www.w3.org/2000/01/rdf-schema#range"]instanceof Array){for(let r of e["http://www.w3.org/2000/01/rdf-schema#range"])if(xe(r)){let o=r["http://www.w3.org/2002/07/owl#equivalentClass"][0]["http://www.w3.org/2002/07/owl#onProperty"][0]["@id"],a=r["http://www.w3.org/2002/07/owl#equivalentClass"][0]["http://www.w3.org/2002/07/owl#allValuesFrom"][0]["@id"];if(a&&o==="http://www.w3.org/ns/hydra/core#member")return t.get(a)}}for(let r of e["http://www.w3.org/ns/hydra/core#supportedOperation"]||[]){if(!r["http://www.w3.org/ns/hydra/core#returns"])continue;let o=r["http://www.w3.org/ns/hydra/core#returns"][0]["@id"];if(typeof o=="string"&&o.indexOf("http://www.w3.org/ns/hydra/core")!==0)return t.get(o)}}function z(t){return"@value"in t?t["@value"]:Object.fromEntries(Object.entries(t).map(([e,r])=>{let o=e.substring(e.lastIndexOf("#")+1);return r instanceof Array?r.length===1?r[0]instanceof Object?[o,z(r[0])]:[o,r[0]]:r[0]instanceof Object?[o,r.map(z)]:[o,r]:r instanceof Object?[o,z(r)]:[o,r]}))}async function Et(t){let{docs:e,entrypoint:r}=await fe(t),o=be(e),a=o.get(r["@type"][0]),w=[];return a&&(w=a["http://www.w3.org/ns/hydra/core#supportedProperty"].reduce((s,n)=>{if(n["http://www.w3.org/ns/hydra/core#property"][0]){let[l]=n["http://www.w3.org/ns/hydra/core#property"],p=ve(o,l);if(p&&r[l["@id"]]){let u=z({...p,"http://www.w3.org/ns/hydra/core#supportedOperation":[...l["http://www.w3.org/ns/hydra/core#supportedOperation"],...p["http://www.w3.org/ns/hydra/core#supportedOperation"]]}),[i]=r[l["@id"]];s.push({...u,url:typeof i=="string"?i:i["@id"]})}}return s},[])),w}function Xw(t,e){let r=[...t],o=Object.fromEntries(e.map(({position:a,productId:w})=>[w,a]));return r.sort((a,w)=>o[et(a.id)]-o[et(w.id)])}function Hw(t,e){var r;return(r=e.find(o=>t===o.id))==null?void 0:r.limitationType}function Bw(t){return t?"stock.inStock":"stock.outOfStock"}function ot(t){return t.type==="combination"}function Ot(t){return t.type==="attribute"}function Ce(t,e){var r;return(r=e[t.attribute_type])==null?void 0:r[t.operator]}function Se(t){return(t==null?void 0:t.startsWith("["))&&(t==null?void 0:t.endsWith("]"))}function Lt(t){return ot(t)?{...t,value:t.value==="true",children:t.children.map(e=>Lt(e))}:t}function rs(t){let e;try{e=Lt(JSON.parse(t.virtualRule))}catch{e=mt}return{...t,virtualRule:e}}function Rt(t,e){if(ot(t))return{...t,value:String(t.value),children:t.children.map(r=>Rt(r,e))};if(Ot(t)){let r=t.value,o=Ce(t,e.operatorsValueType);return Se(o)&&t.value instanceof Array?V.includes(o.slice(1,-1))?r=t.value.map(Number):r=t.value.map(String):V.includes(o)?r=Number(t.value):o==="String"&&(r=String(t.value)),{...t,value:r}}return t}function os(t,e){return t.virtualRule?{...t,virtualRule:JSON.stringify(Rt(t.virtualRule,e))}:t}function as(t){let e={...t};return t.id||(delete e["@id"],delete e.id),e}function Ie(t){if(t){if(ot(t))return t.children.every(Ie);if(Ot(t))return t.field!==""&&t.operator!==""&&t.value!==""}else return!0;return!0}function ss(t){return{"&::-webkit-scrollbar":{position:"sticky",bottom:"150px",height:"4px",width:"4px"},"&::-webkit-scrollbar-track":{backgroundColor:`${t.palette.colors.white}`,top:"15px"},"&::-webkit-scrollbar-thumb":{backgroundColor:`${t.palette.neutral.main}`,borderRadius:"15px",top:"15px"}}}function Fe(t){let e=S(t);return e==="boolean"?"boolean":e==="integer"||e==="float"||e==="percentage"?"number":"string"}var Pe=Object.values(D);function je(t){return Pe.includes(t)}function Tt(t,e){var r;return((r=t.gally)==null?void 0:r.input)&&je(t.gally.input)?t.gally.input:e}var v={prompt:{attribute:"pattern",value:"^(?:(?!%)[\\s\\S])*%s(?:(?!%)[\\s\\S])*$",error:{name:"patternMismatch",message:"prompt"}},email:{attribute:"type",value:"email",error:{name:"typeMismatch",message:"typeMismatchEmail"}}};function Dt(t){var a,w,s;let e={},r={},o=!1;return Object.entries(((a=t.gally)==null?void 0:a.validation)||{}).forEach(([n,l])=>{v[n]&&l?(e[v[n].attribute]=v[n].value,r[v[n].error.name]=v[n].error.message,o=!0):!v[n]&&typeof l!="boolean"&&(e[n]=l)}),{depends:(w=t.gally)==null?void 0:w.depends,field:t,suffix:((s=t.gally)==null?void 0:s.input)==="percentage"?"%":"",validation:e,showError:o,replacementErrorsMessages:r}}function bs(t,e){var s,n,l,p,u,i,P,f,at,wt;let r=Dt(t),o=Fe(t),a=t.title,w=Tt(t,o);return{...r,editable:((s=t.gally)==null?void 0:s.editable)&&t.writeable,fieldset:(n=t.gally)==null?void 0:n.fieldset,gridHeaderInfoTooltip:(l=t.gally)==null?void 0:l.gridHeaderInfoTooltip,id:a,input:w,infoTooltip:(p=t.gally)==null?void 0:p.infoTooltip,label:t.property.label??e(...G(t.title)),name:a,required:((u=t.gally)==null?void 0:u.required)??t.required,type:o,multipleValueFormat:(i=t.gally)==null?void 0:i.multipleValueFormat,requestTypeConfigurations:(P=t.gally)==null?void 0:P.requestTypeConfigurations,multipleInputConfiguration:(f=t.gally)==null?void 0:f.multipleInputConfiguration,placeholder:(at=t.gally)==null?void 0:at.placeholder,defaultValue:(wt=t.gally)==null?void 0:wt.defaultValue}}function Ee(t){return t.multiple?"select":gt.test(t.property)?"boolean":"string"}function xs(t,e){let r=Dt(t.field),o=Ee(t),a=t.variable,w=Tt(t.field,o);return{...r,editable:!0,id:a,input:t.variable.endsWith("[between]")?"range":w,label:t.field?t.field.property.label??e(...G(t.field.title)):e(...G(t.property)),multiple:t.multiple,name:a,required:!1,type:o}}function vs(t,e){let r=t==null?void 0:t["hydra:search"]["hydra:mapping"].filter(a=>!a.variable.endsWith("[lt]")&&!a.variable.endsWith("[gt]")&&!a.variable.endsWith("[lte]")&&!a.variable.endsWith("[gte]")).map(a=>({...a,field:$(e,a.property),multiple:a.variable.endsWith("[]")})).filter(a=>a.field),o=r.filter(a=>a.multiple).map(a=>a.property);return r==null?void 0:r.filter(a=>{var w;return(w=a.field.gally)==null?void 0:w.visible}).filter(a=>!o.includes(a.property)||a.multiple).sort((a,w)=>{var s,n;return((s=a.field.gally)==null?void 0:s.position)-((n=w.field.gally)==null?void 0:n.position)})}function Oe(t){return typeof t=="object"&&"path"in t?t.path:t}function Le(t){return typeof t=="object"&&"path"in t&&"icons"in t}function Cs(t,e){let r=e;return typeof r!="string"&&Le(e)?r={...r,path:tt(t,r.path)}:r=tt(t,Oe(r)),r}import Re from"jwt-decode";function Fs(t){return Boolean(t&&Date.now()/1e3<t.exp)}function Ps(t){return Re(t)}function wl(){let[t,e]=De({status:1});return Te(()=>{t.status===1&&(e({status:2}),Et(_()).then(r=>e({status:3,data:r})).catch(r=>e({error:r,status:0})))},[t.status]),t}var pl={"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",gally:{input:"select",options:{values:[{value:"test1",label:"option_test1"},{value:"test2",label:"option_test2"}]},editable:!1,position:10,visible:!0},property:{"@id":"https://localhost/docs.jsonld#SourceField/code","@type":"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",domain:{"@id":"https://localhost/docs.jsonld#SourceField"},range:{"@id":"http://www.w3.org/2001/XMLSchema#string"},label:"Attribute code"},readable:!0,required:!0,title:"code",writeable:!0},dl={"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",gally:{input:"select",options:{values:[{value:"test1",label:"option_test1"},{value:"test2",label:"option_test2"}]},editable:!1,position:10,visible:!0,context:{settings_attribute:{visible:!0,position:20},search_configuration_attribute:{visible:!1,position:30}}},property:{"@id":"https://localhost/docs.jsonld#SourceField/code","@type":"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",domain:{"@id":"https://localhost/docs.jsonld#SourceField"},range:{"@id":"http://www.w3.org/2001/XMLSchema#string"},label:"Attribute code"},readable:!0,required:!0,title:"code",writeable:!0},hl={"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",gally:{context:{search_configuration_attributes:{visible:!0}},editable:!0,position:60,visible:!0,form:{visible:!1}},property:{"@id":"http://localhost:6006//docs.jsonld#SourceField/isSortable","@type":"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",domain:{"@id":"http://localhost:6006//docs.jsonld#SourceField"},range:{"@id":"http://www.w3.org/2001/XMLSchema#boolean"},label:"Sortable"},readable:!0,required:!1,title:"isSortable",writeable:!0},il={"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",gally:{input:"select",options:{api_rest:"/product_sorting_options"},editable:!1,position:10,visible:!0},property:{"@id":"https://localhost/docs.jsonld#SourceField/code","@type":"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",domain:{"@id":"https://localhost/docs.jsonld#SourceField"},range:{"@id":"http://www.w3.org/2001/XMLSchema#string"},label:"Attribute code"},readable:!0,required:!0,title:"code",writeable:!0},At=[{"@id":"https://localhost/docs.jsonld#Index","@type":"http://www.w3.org/ns/hydra/core#Class",supportedOperation:[{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/FindAction"],method:"GET",title:"Retrieves the collection of Index resources.",label:"Retrieves the collection of Index resources.",returns:{"@id":"http://www.w3.org/ns/hydra/core#Collection"}},{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/CreateAction"],expects:{"@id":"https://localhost/docs.jsonld#Index"},method:"POST",title:"Creates a Index resource.",label:"Creates a Index resource.",returns:{"@id":"https://localhost/docs.jsonld#Index"}},{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/FindAction"],method:"GET",title:"Retrieves Index resource.",label:"Retrieves Index resource.",returns:{"@id":"https://localhost/docs.jsonld#Index"}},{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/DeleteAction"],method:"DELETE",title:"Deletes the Index resource.",label:"Deletes the Index resource.",returns:{"@id":"http://www.w3.org/2002/07/owl#Nothing"}},{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/ReplaceAction"],expects:{"@id":"https://localhost/docs.jsonld#Index"},method:"PUT",title:"Replaces the Index resource.",label:"Replaces the Index resource.",returns:{"@id":"https://localhost/docs.jsonld#Index"}},{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/ReplaceAction"],expects:{"@id":"https://localhost/docs.jsonld#Index"},method:"PUT",title:"Replaces the Index resource.",label:"Replaces the Index resource.",returns:{"@id":"https://localhost/docs.jsonld#Index"}}],supportedProperty:[{"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",property:{"@id":"https://localhost/docs.jsonld#Index/name","@type":"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",domain:{"@id":"https://localhost/docs.jsonld#Index"},range:{"@id":"http://www.w3.org/2001/XMLSchema#string"},label:"name"},readable:!0,required:!1,title:"name",writeable:!0},{"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",property:{"@id":"https://localhost/docs.jsonld#Index/aliases","@type":"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",domain:{"@id":"https://localhost/docs.jsonld#Index"},range:{"@id":"http://www.w3.org/2001/XMLSchema#string"},label:"aliases"},readable:!0,required:!1,title:"aliases",writeable:!0},{"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",property:{"@id":"https://localhost/docs.jsonld#Index/docsCount","@type":"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",domain:{"@id":"https://localhost/docs.jsonld#Index"},range:{"@id":"http://www.w3.org/2001/XMLSchema#integer"},label:"docsCount"},readable:!0,required:!1,title:"docsCount",writeable:!0},{"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",property:{"@id":"https://localhost/docs.jsonld#Index/size","@type":"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",domain:{"@id":"https://localhost/docs.jsonld#Index"},range:{"@id":"http://www.w3.org/2001/XMLSchema#string"},label:"size"},readable:!0,required:!1,title:"size",writeable:!0},{"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",property:{"@id":"https://localhost/docs.jsonld#Index/entityType","@type":"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",domain:{"@id":"https://localhost/docs.jsonld#Index"},range:{"@id":"http://www.w3.org/2001/XMLSchema#string"},label:"entityType"},readable:!0,required:!1,title:"entityType",writeable:!0},{"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",property:{"@id":"https://localhost/docs.jsonld#Index/catalog","@type":"http://www.w3.org/ns/hydra/core#Link",domain:{"@id":"https://localhost/docs.jsonld#Index"},maxCardinality:1,range:{"@id":"https://localhost/docs.jsonld#LocalizedCatalog"},label:"catalog"},readable:!0,required:!1,title:"catalog",writeable:!0},{"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",property:{"@id":"https://localhost/docs.jsonld#Index/status","@type":"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",domain:{"@id":"https://localhost/docs.jsonld#Index"},range:{"@id":"http://www.w3.org/2001/XMLSchema#string"},label:"status"},readable:!0,required:!1,title:"status",writeable:!0}],title:"Index",label:"Index",url:"https://localhost/indices"},{"@id":"https://localhost/docs.jsonld#IndexDocument","@type":"http://www.w3.org/ns/hydra/core#Class",supportedOperation:[{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/FindAction"],method:"GET",title:"Retrieves the collection of IndexDocument resources.",label:"Retrieves the collection of IndexDocument resources.",returns:{"@id":"http://www.w3.org/ns/hydra/core#Collection"}},{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/CreateAction"],expects:{"@id":"https://localhost/docs.jsonld#IndexDocument"},method:"POST",title:"Creates a IndexDocument resource.",label:"Creates a IndexDocument resource.",returns:{"@id":"https://localhost/docs.jsonld#IndexDocument"}},{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/FindAction"],method:"GET",title:"Retrieves IndexDocument resource.",label:"Retrieves IndexDocument resource.",returns:{"@id":"https://localhost/docs.jsonld#IndexDocument"}},{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/DeleteAction"],method:"DELETE",title:"Deletes the IndexDocument resource.",label:"Deletes the IndexDocument resource.",returns:{"@id":"http://www.w3.org/2002/07/owl#Nothing"}}],supportedProperty:[{"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",property:{"@id":"https://localhost/docs.jsonld#IndexDocument/indexName","@type":"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",domain:{"@id":"https://localhost/docs.jsonld#IndexDocument"},range:{"@id":"http://www.w3.org/2001/XMLSchema#string"},label:"indexName"},readable:!0,required:!1,title:"indexName",writeable:!0},{"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",property:{"@id":"https://localhost/docs.jsonld#IndexDocument/documents","@type":"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",domain:{"@id":"https://localhost/docs.jsonld#IndexDocument"},range:{"@id":"http://www.w3.org/2001/XMLSchema#string"},label:"documents"},readable:!0,required:!1,title:"documents",writeable:!0}],title:"IndexDocument",label:"IndexDocument",url:"https://localhost/index_documents"},{"@id":"https://localhost/docs.jsonld#SourceFieldOption","@type":"http://www.w3.org/ns/hydra/core#Class",supportedOperation:[{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/FindAction"],method:"GET",title:"Retrieves the collection of SourceFieldOption resources.",label:"Retrieves the collection of SourceFieldOption resources.",returns:{"@id":"http://www.w3.org/ns/hydra/core#Collection"}},{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/CreateAction"],expects:{"@id":"https://localhost/docs.jsonld#SourceFieldOption"},method:"POST",title:"Creates a SourceFieldOption resource.",label:"Creates a SourceFieldOption resource.",returns:{"@id":"https://localhost/docs.jsonld#SourceFieldOption"}},{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/FindAction"],method:"GET",title:"Retrieves SourceFieldOption resource.",label:"Retrieves SourceFieldOption resource.",returns:{"@id":"https://localhost/docs.jsonld#SourceFieldOption"}},{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/ReplaceAction"],expects:{"@id":"https://localhost/docs.jsonld#SourceFieldOption"},method:"PUT",title:"Replaces the SourceFieldOption resource.",label:"Replaces the SourceFieldOption resource.",returns:{"@id":"https://localhost/docs.jsonld#SourceFieldOption"}},{"@type":"http://www.w3.org/ns/hydra/core#Operation",expects:{"@id":"https://localhost/docs.jsonld#SourceFieldOption"},method:"PATCH",title:"Updates the SourceFieldOption resource.",label:"Updates the SourceFieldOption resource.",returns:{"@id":"https://localhost/docs.jsonld#SourceFieldOption"}},{"@type":["http://www.w3.org/ns/hydra/core#Operation","http://schema.org/DeleteAction"],method:"DELETE",title:"Deletes the SourceFieldOption resource.",label:"Deletes the SourceFieldOption resource.",returns:{"@id":"http://www.w3.org/2002/07/owl#Nothing"}}],supportedProperty:[{"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",property:{"@id":"https://localhost/docs.jsonld#SourceFieldOption/sourceField","@type":"http://www.w3.org/ns/hydra/core#Link",domain:{"@id":"https://localhost/docs.jsonld#SourceFieldOption"},maxCardinality:1,range:{"@id":"https://localhost/docs.jsonld#SourceField"},label:"sourceField"},readable:!0,required:!0,title:"sourceField",writeable:!0},{"@type":"http://www.w3.org/ns/hydra/core#SupportedProperty",property:{"@id":"https://localhost/docs.jsonld#SourceFieldOption/position","@type":"http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",domain:{"@id":"https://localhost/docs.jsonld#SourceFieldOption"},range:{"@id":"http://www.w3.org/2001/XMLSchema#integer"},label:"position"},readable: