What is the meaning of Chancellery?

The rank or post of a chancellor

The office or staff of a chancellor

The building in which such an office is situated

Source: wiktionary.org